Computer Graphics. Lecture 2. Doç. Dr. Mehmet Gokturk

Size: px
Start display at page:

Download "Computer Graphics. Lecture 2. Doç. Dr. Mehmet Gokturk"

Transcription

1 Computer Graphics Lecture 2 Doç. Dr. Mehmet Gokturk

2 Mathematical Foundations l Hearn and Baker (A1 A4) appendix gives good review l Some of the mathematical tools l Trigonometry l Vector spaces l Points, vectors, and coordinates l Dot and cross products l Linear transforms and matrices M. Gokturk 2

3 2D Geometry l Know your high school geometry: l Total angle around a circle is 360 or 2π radians l When two lines cross: l Opposite angles are equivalent l Angles along line sum to 180 l Similar triangles: l All corresponding angles are equivalent M. Gokturk 3

4 Trigonometry l Sine: opposite over hypotenuse l Cosine: adjacent over hypotenuse l Tangent: opposite over adjacent l Unit circle definitions: l sin (Θ) = x l cos (Θ) = y l tan (Θ) = x/y l Etc (x, y) M. Gokturk 4

5 Slope-intercept Line Equation Slope = m = rise / run Slope = (y - y1) / (x - x1) = (y2 - y1) / (x2 - x1) Solve for y: y = [(y2 - y1)/(x2 - x1)]x + [-(y2-y1)/(x2 - x1)]x1 + y1 or: y = mx + b y P = (x, y) P2 = (x2, y2) P1 = (x1, y1) M. Gokturk 5

6 Parametric Line Equation l Given points P1 = (x1, y1) and P2 = (x2, y2) x = x1 + t(x2 - x1) y = y1 + t(y2 - y1) l When: l t=0, we get (x1, y1) l t=1, we get (x2, y2) l (0<t<1), we get points on the segment between (x1, y1) and (x2, y2) y P2 = (x2, y2) P1 = (x1, y1) x M. Gokturk 6

7 Other helpful formulas l Length = sqrt ((x2 - x1) 2 + (y2 - y1) 2 ) l Midpoint, p2, between p1 and p3 p2 = ((x1 + x3) / 2, (y1 + y3) / 2)) l Two lines are perpendicular if: M1 = -1/M2 cosine of the angle between them is 0 M. Gokturk 7

8 Coordinate Systems Grasp z-axis with hand Roll fingers from positive x-axis towards positive y-axis Thumb points in direction of z-axis Y Y Z X X Left-handed coordinate system Z Right-handed coordinate system M. Gokturk 8

9 Points l Points support these operations l Point-point subtraction: Q - P = v l Result is a vector pointing from P to Q l Vector-point addition: l Result is a new point P + v = Q l Note that the addition of two points is not defined Q v P M. Gokturk 9

10 Vectors l We commonly use vectors to represent: l Points in space (i.e., location) l Displacements from point to point l Direction (i.e., orientation) M. Gokturk 10

11 Vector Spaces l Two types of elements: l Scalars (real numbers): α, β, γ, δ, l Vectors (n-tuples): u, v, w, l Operations: l Addition l Subtraction l Dot Product l Cross Product l Norm M. Gokturk 11

12 Vector Addition/Subtraction l operation u + v, with: l Identity 0 v + 0 = v l Inverse - v + (-v) = 0 l Vectors are arrows rooted at the origin l Addition uses the parallelogram rule : y u+v y v v u u x -v u-v x M. Gokturk 12

13 Scalar Multiplication l Scalar multiplication: l Distributive rule: α(u + v) = α(u) + α(v) (α + β)u = αu + βu l Scalar multiplication streches a vector, changing its length (magnitude) but not its direction M. Gokturk 13

14 Dot Product l The dot product or, more generally, inner product of two vectors is a scalar: l Useful for many purposes v 1 v 2 = x 1 x 2 + y 1 y 2 + z 1 z 2 (in 3D) l Computing the length (Euclidean Norm) of a vector: length(v) = v = sqrt(v v) l l l Normalizing a vector, making it unit-length: v = v / v Computing the angle between two vectors: u v = u v cos(θ) Checking two vectors for orthogonality l u v = 0.0 v u θ M. Gokturk 14

15 Dot Product l Projecting one vector onto another l If v is a unit vector and we have another vector, w l We can project w perpendicularly onto v w v l And the result, u, has length u w v u = w cos(θ ) v w w = v w = v w M. Gokturk 15

16 Dot Product l Is commutative u v = v u l Is distributive with respect to addition u (v + w) = u v + u w M. Gokturk 16

17 M. Gokturk 17 Cross Product l The cross product or vector product of two vectors is a vector: l The cross product of two vectors is orthogonal to both l Right-hand rule dictates direction of cross product = ) ( y x y x z x z x z y z y v v

18 Cross Product Right Hand Rule l Orient your right hand such that your palm is at the beginning of A and your fingers point in the direction of A l Twist your hand about the A-axis such that B extends perpendicularly from your palm l As you curl your fingers to make a fist, your thumb will point in the direction of the cross product M. Gokturk 18

19 Triangle Arithmetic l Consider a triangle, (a, b, c) l a,b,c = (x,y,z) tuples l Surface area = s a = ½ * (b a) X (c-a) l Unit normal = (1/2s a ) * (b-a) X (c-a) b a c M. Gokturk 19

20 Vector Spaces l A linear combination of vectors results in a new vector: v = α 1 v 1 + α 2 v α n v n l If the only set of scalars such that l l α 1 v 1 + α 2 v α n v n = 0 is α 1 = α 2 = = α 3 = 0 then we say the vectors are linearly independent The dimension of a space is the greatest number of linearly independent vectors possible in a vector set For a vector space of dimension n, any set of n linearly independent vectors form a basis M. Gokturk 20

21 Vector Spaces: Basis Vectors l Given a basis for a vector space: l Each vector in the space is a unique linear combination of the basis vectors l The coordinates of a vector are the scalars from this linear combination l If basis vectors are orthogonal and unit length: l Vectors comprise orthonormal basis l Best-known example: Cartesian coordinates l Note that a given vector v will have different coordinates for different bases M. Gokturk 21

22 Lines l (P1,P2) l Drawing lines l On paper with pencil l On screen? l Rasterization M. Gokturk 22

23 Line Drawing l Scan-conversion or rasterization l Due to the scanning nature of raster displays l Algorithms are fundamental to both 2-D and 3-D computer graphics l Transforming the continuous into this discrete (sampling) l Line drawing was easy for vector displays l l Most incremental line-drawing algorithms were first developed for pen-plotters M. Gokturk 23

24 The Ideal Line??? l The best we can do is a discrete approximation of an ideal line. 1. Important line qualities: l l l l l Continuous appearence Uniform thickness and brightness Accuracy (Turn on the pixels nearest the ideal line) Speed (How fast is the line generated) M. Gokturk 24

25 Simple Line l Based on the simple slope-intercept algorithm from algebra y = m x + b M. Gokturk 25

26 Simple Line Code public void linesimple(int x0, int y0, int x1, int y1, Color color) { } int pix = color.getrgb(); int dx = x1 - x0; int dy = y1 - y0; raster.setpixel(pix, x0, y0); if (dx!= 0) { } float m = (float) dy / (float) dx; float b = y0 - m*x0; dx = (x1 > x0)? 1 : -1; while (x0!= x1) { } x0 += dx; y0 = Math.round(m*x0 + b); raster.setpixel(pix, x0, y0); SEE THE EXAMPLE M. Gokturk 26

27 results for slopes > 1????? l Problem: linesimple( ) does not give satisfactory results for slopes > 1 l Solution: symmetry M. Gokturk 27

28 Solution Code public void lineimproved(int x0, int y0, int x1, int y1, Color color) { int pix = color.getrgb(); int dx = x1 - x0; int dy = y1 - y0; raster.setpixel(pix, x0, y0); if (Math.abs(dx) > Math.abs(dy)) { // slope < 1 float m = (float) dy / (float) dx; // compute slope float b = y0 - m*x0; dx = (dx < 0)? -1 : 1; while (x0!= x1) { x0 += dx; raster.setpixel(pix, x0, Math.round(m*x0 + b)); } } else if (dy!= 0) { // slope >= 1 float m = (float) dx / (float) dy; // compute slope float b = x0 - m*y0; dy = (dy < 0)? -1 : 1; while (y0!= y1) { y0 += dy; raster.setpixel(pix, Math.round(m*y0 + b), y0); } } SEE THE EXAMPLE M. Gokturk 28

29 Optimize Inner Loops l l l Optimize those code fragments where the algorithm spends most of its time Often these fragments are inside loops Overall code organization: linemethod( ){ // 1. general set up // 2. special case set up } while (notdone) { } // 3. inner loop M. Gokturk 29

30 Optimize Inner Loops l remove unnecessary method invocations l replace Math.round(m*x0 + b) with (int)(m*x0 + b + 0.5) Does this always work? use incremental calculations Consider the expression l y = (int)(m*x + b + 0.5) l The value of y is known at x 0 (i.e. it is y ) Future values of y can be expressed in terms of previous values with a difference equation: l y i+1 = y i + m; or y i+1 = y i - m; M. Gokturk 30

31 public void linedda(int x0, int y0, int x1, int y1, Color color) { int pix = color.getrgb(); int dy = y1 - y0; int dx = x1 - x0; float t = (float) 0.5; // offset for rounding raster.setpixel(pix, x0, y0); if (Math.abs(dx) > Math.abs(dy)) { // slope < 1 float m = (float) dy / (float) dx; // compute slope t += y0; dx = (dx < 0)? -1 : 1; m *= dx; while (x0!= x1) { x0 += dx; // step to next x value t += m; // add slope to y value raster.setpixel(pix, x0, (int) t); } } else { // slope >= 1 float m = (float) dx / (float) dy; // compute slope t += x0; dy = (dy < 0)? -1 : 1; m *= dy; while (y0!= y1) { y0 += dy; // step to next y value t += m; // add slope to x value raster.setpixel(pix, (int) t, y0); } SEE THE } EXAMPLE } M. Gokturk 31

32 DDA Algorithm l Digital Differential Analyzer y2 = y1 + m Keeps adding the slope to nearest integer Can we improve it? M. Gokturk 32

33 Better Approach Bresenham s l Decide which circle is to be filled fraction += m; if (fraction >= 1) { y = y + 1; fraction -= 1; } fraction = 0.5; // Initial fraction += m; // Increment if 0.5 <= m <= 1 then fraction >= 1 Plot(x2,y1+1) if 0 < m < 0.5 then fraction < 1 Plot(x2,y1) BENCHMARK M. Gokturk 33

34 Bresenham s public void linebresenham(int x0, int y0, int x1, int y1, Color color) { int pix = color.getrgb(); int dy = y1 - y0; int dx = x1 - x0; int stepx, stepy; if (dy < 0) { dy = -dy; stepy = -1; } else { stepy = 1; } if (dx < 0) { dx = -dx; stepx = -1; } else { stepx = 1; } dy <<= 1; // dy is now 2*dy dx <<= 1; // dx is now 2*dx raster.setpixel(pix, x0, y0); if (dx > dy) { int fraction = dy - (dx >> 1); // same as 2*dy - dx while (x0!= x1) { if (fraction >= 0) { y0 += stepy; fraction -= dx; // same as fraction -= 2*dx 2*dy } x0 += stepx; fraction += dy; // same as fraction -= raster.setpixel(pix, x0, y0); } } else { int fraction = dx - (dy >> 1); while (y0!= y1) { if (fraction >= 0) { x0 += stepx; fraction -= dy; } y0 += stepy; fraction += dx; raster.setpixel(pix, x0, y0); } } M. Gokturk 34 }

35 Other Issues l Non-integer endpoints (occurs frequently when rendering 3D lines) l Can we make lines appear less "jaggy"? l What if a line endpoint lies outside the viewing area? l How do you handle thick lines? l Optimizations for connected line segments l Lines show up in the strangest places M. Gokturk 35

36 Drawing Circles use this equation to compute the pixels of the circle A circle exhibits a great deal of symmetry M. Gokturk 36

37 More Symmetry We can find any point's symmetric complement about these lines by permuting the indices. For example the point (x,y) has a complementary point (y,x) about the line x=y. And the total set of complements for the point (x,y) are {(x,-y), (-x,y), (-x,-y), (y,x), (y,-x), (-y,x), (-y,-x)} M. Gokturk 37

38 Bresenham s Algorithm EXAMPLE M. Gokturk 38

39 Other Primitives l Read Hearn Baker on How to Draw an Ellipse l Bresenham s algorithm fits as well l Hyperbolas l We will talk more on parametric curves later. Bresenham s and modified versions of it (midpoint) can be used for all parametric curves. M. Gokturk 39

40 Next Week l 2D transformations M. Gokturk 40

41 Assignment l Implement DDA and Bresenham s line drawing algorithms l Draw an arbitrary artwork (use your own intuition) l JAVA and/or OPENGL will be used l Turn in your assignments timely l WILL BE IMPLEMENTED ON ANDROID M. Gokturk 41

Display Technologies: CRTs Raster Displays

Display Technologies: CRTs Raster Displays Rasterization Display Technologies: CRTs Raster Displays Raster: A rectangular array of points or dots Pixel: One dot or picture element of the raster Scanline: A row of pixels Rasterize: find the set

More information

From Ver(ces to Fragments: Rasteriza(on

From Ver(ces to Fragments: Rasteriza(on From Ver(ces to Fragments: Rasteriza(on From Ver(ces to Fragments 3D vertices vertex shader rasterizer fragment shader final pixels 2D screen fragments l determine fragments to be covered l interpolate

More information

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives. D Graphics Primitives Eye sees Displays - CRT/LCD Frame buffer - Addressable pixel array (D) Graphics processor s main function is to map application model (D) by projection on to D primitives: points,

More information

Output Primitives Lecture: 4. Lecture 4

Output Primitives Lecture: 4. Lecture 4 Lecture 4 Circle Generating Algorithms Since the circle is a frequently used component in pictures and graphs, a procedure for generating either full circles or circular arcs is included in most graphics

More information

Solution Notes. COMP 151: Terms Test

Solution Notes. COMP 151: Terms Test Family Name:.............................. Other Names:............................. ID Number:............................... Signature.................................. Solution Notes COMP 151: Terms

More information

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored.

From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored. From Vertices to Fragments: Rasterization Reading Assignment: Chapter 7 Frame Buffer Special memory where pixel colors are stored. System Bus CPU Main Memory Graphics Card -- Graphics Processing Unit (GPU)

More information

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6. ) is graphed below:

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6. ) is graphed below: Polar Coordinates Any point in the plane can be described by the Cartesian coordinates (x, y), where x and y are measured along the corresponding axes. However, this is not the only way to represent points

More information

Scan Conversion. Drawing Lines Drawing Circles

Scan Conversion. Drawing Lines Drawing Circles Scan Conversion Drawing Lines Drawing Circles 1 How to Draw This? 2 Start From Simple How to draw a line: y(x) = mx + b? 3 Scan Conversion, a.k.a. Rasterization Ideal Picture Raster Representation Scan

More information

Computer Graphics: Graphics Output Primitives Line Drawing Algorithms

Computer Graphics: Graphics Output Primitives Line Drawing Algorithms Computer Graphics: Graphics Output Primitives Line Drawing Algorithms By: A. H. Abdul Hafez Abdul.hafez@hku.edu.tr, 1 Outlines 1. Basic concept of lines in OpenGL 2. Line Equation 3. DDA Algorithm 4. DDA

More information

Basics of Computational Geometry

Basics of Computational Geometry Basics of Computational Geometry Nadeem Mohsin October 12, 2013 1 Contents This handout covers the basic concepts of computational geometry. Rather than exhaustively covering all the algorithms, it deals

More information

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6 Polar Coordinates Any point in the plane can be described by the Cartesian coordinates (x, y), where x and y are measured along the corresponding axes. However, this is not the only way to represent points

More information

Rendering. A simple X program to illustrate rendering

Rendering. A simple X program to illustrate rendering Rendering A simple X program to illustrate rendering The programs in this directory provide a simple x based application for us to develop some graphics routines. Please notice the following: All points

More information

Chapter 8: Implementation- Clipping and Rasterization

Chapter 8: Implementation- Clipping and Rasterization Chapter 8: Implementation- Clipping and Rasterization Clipping Fundamentals Cohen-Sutherland Parametric Polygons Circles and Curves Text Basic Concepts: The purpose of clipping is to remove objects or

More information

Rendering. A simple X program to illustrate rendering

Rendering. A simple X program to illustrate rendering Rendering A simple X program to illustrate rendering The programs in this directory provide a simple x based application for us to develop some graphics routines. Please notice the following: All points

More information

CPSC / Scan Conversion

CPSC / Scan Conversion CPSC 599.64 / 601.64 Computer Screens: Raster Displays pixel rasters (usually) square pixels in rectangular raster evenly cover the image problem no such things such as lines, circles, etc. scan conversion

More information

CS 130. Scan Conversion. Raster Graphics

CS 130. Scan Conversion. Raster Graphics CS 130 Scan Conversion Raster Graphics 2 1 Image Formation Computer graphics forms images, generally two dimensional, using processes analogous to physical imaging systems like: - Cameras - Human visual

More information

Line Drawing Week 6, Lecture 9

Line Drawing Week 6, Lecture 9 CS 536 Computer Graphics Line Drawing Week 6, Lecture 9 David Breen, William Regli and axim Peysakhov Department of Computer Science Drexel University Outline Line drawing Digital differential analyzer

More information

R asterisation. Part I: Simple Lines. Affine transformation. Transform Render. Rasterisation Line Rasterisation 2/16

R asterisation. Part I: Simple Lines. Affine transformation. Transform Render. Rasterisation Line Rasterisation 2/16 ECM2410:GraphicsandAnimation R asterisation Part I: Simple Lines Rasterisation 1/16 Rendering a scene User space Device space Affine transformation Compose Transform Render Com pose from primitives (lines,

More information

CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines. Emmanuel Agu

CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines. Emmanuel Agu CS 4731: Computer Graphics Lecture 21: Raster Graphics: Drawing Lines Emmanuel Agu 2D Graphics Pipeline Clipping Object World Coordinates Applying world window Object subset window to viewport mapping

More information

Announcements. Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class. Computer Graphics

Announcements. Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class. Computer Graphics Announcements Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class 1 Scan Conversion Overview of Rendering Scan Conversion Drawing Lines Drawing Polygons

More information

CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE

CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE DRAWING PRIMITIVES: LEGACY VS. NEW Legacy: specify primitive in glbegin() glbegin(gl_points); glvertex3f(1,5,0);

More information

Graphics and Interaction Transformation geometry and homogeneous coordinates

Graphics and Interaction Transformation geometry and homogeneous coordinates 433-324 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation

More information

Chapter - 2: Geometry and Line Generations

Chapter - 2: Geometry and Line Generations Chapter - 2: Geometry and Line Generations In Computer graphics, various application ranges in different areas like entertainment to scientific image processing. In defining this all application mathematics

More information

Rasterization, or What is glbegin(gl_lines) really doing?

Rasterization, or What is glbegin(gl_lines) really doing? Rasterization, or What is glbegin(gl_lines) really doing? Course web page: http://goo.gl/eb3aa February 23, 2012 Lecture 4 Outline Rasterizing lines DDA/parametric algorithm Midpoint/Bresenham s algorithm

More information

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates

COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates COMP30019 Graphics and Interaction Transformation geometry and homogeneous coordinates Department of Computer Science and Software Engineering The Lecture outline Introduction Vectors and matrices Translation

More information

Honors Precalculus: Solving equations and inequalities graphically and algebraically. Page 1

Honors Precalculus: Solving equations and inequalities graphically and algebraically. Page 1 Solving equations and inequalities graphically and algebraically 1. Plot points on the Cartesian coordinate plane. P.1 2. Represent data graphically using scatter plots, bar graphs, & line graphs. P.1

More information

Rasterization: Geometric Primitives

Rasterization: Geometric Primitives Rasterization: Geometric Primitives Outline Rasterizing lines Rasterizing polygons 1 Rasterization: What is it? How to go from real numbers of geometric primitives vertices to integer coordinates of pixels

More information

Output Primitives. Dr. S.M. Malaek. Assistant: M. Younesi

Output Primitives. Dr. S.M. Malaek. Assistant: M. Younesi Output Primitives Dr. S.M. Malaek Assistant: M. Younesi Output Primitives Output Primitives: Basic geometric structures (points, straight line segment, circles and other conic sections, quadric surfaces,

More information

EF432. Introduction to spagetti and meatballs

EF432. Introduction to spagetti and meatballs EF432 Introduction to spagetti and meatballs CSC 418/2504: Computer Graphics Course web site (includes course information sheet): http://www.dgp.toronto.edu/~karan/courses/418/fall2015 Instructor: Karan

More information

Scan Conversion. CMP 477 Computer Graphics S. A. Arekete

Scan Conversion. CMP 477 Computer Graphics S. A. Arekete Scan Conversion CMP 477 Computer Graphics S. A. Areete What is Scan-Conversion? 2D or 3D objects in real world space are made up of graphic primitives such as points, lines, circles and filled polygons.

More information

SM 2. Date: Section: Objective: The Pythagorean Theorem: In a triangle, or

SM 2. Date: Section: Objective: The Pythagorean Theorem: In a triangle, or SM 2 Date: Section: Objective: The Pythagorean Theorem: In a triangle, or. It doesn t matter which leg is a and which leg is b. The hypotenuse is the side across from the right angle. To find the length

More information

Department of Computer Sciences Graphics Fall 2003 (Lecture 2) Pixels

Department of Computer Sciences Graphics Fall 2003 (Lecture 2) Pixels Pixels Pixel: Intensity or color sample. Raster Image: Rectangular grid of pixels. Rasterization: Conversion of a primitive s geometric representation into A set of pixels. An intensity or color for each

More information

Math for Geometric Optics

Math for Geometric Optics Algebra skills Math for Geometric Optics general rules some common types of equations units problems with several variables (substitution) Geometry basics Trigonometry Pythagorean theorem definitions,

More information

CSCI 4620/8626. Coordinate Reference Frames

CSCI 4620/8626. Coordinate Reference Frames CSCI 4620/8626 Computer Graphics Graphics Output Primitives Last update: 2014-02-03 Coordinate Reference Frames To describe a picture, the world-coordinate reference frame (2D or 3D) must be selected.

More information

Output Primitives Lecture: 3. Lecture 3. Output Primitives. Assuming we have a raster display, a picture is completely specified by:

Output Primitives Lecture: 3. Lecture 3. Output Primitives. Assuming we have a raster display, a picture is completely specified by: Lecture 3 Output Primitives Assuming we have a raster display, a picture is completely specified by: - A set of intensities for the pixel positions in the display. - A set of complex objects, such as trees

More information

Realtime 3D Computer Graphics Virtual Reality

Realtime 3D Computer Graphics Virtual Reality Realtime 3D Computer Graphics Virtual Reality From Vertices to Fragments Overview Overall goal recapitulation: Input: World description, e.g., set of vertices and states for objects, attributes, camera,

More information

GRAPHICS OUTPUT PRIMITIVES

GRAPHICS OUTPUT PRIMITIVES CHAPTER 3 GRAPHICS OUTPUT PRIMITIVES LINE DRAWING ALGORITHMS DDA Line Algorithm Bresenham Line Algorithm Midpoint Circle Algorithm Midpoint Ellipse Algorithm CG - Chapter-3 LINE DRAWING Line drawing is

More information

Unit Circle. Project Response Sheet

Unit Circle. Project Response Sheet NAME: PROJECT ACTIVITY: Trigonometry TOPIC Unit Circle GOALS MATERIALS Explore Degree and Radian Measure Explore x- and y- coordinates on the Unit Circle Investigate Odd and Even functions Investigate

More information

Trigonometry Summer Assignment

Trigonometry Summer Assignment Name: Trigonometry Summer Assignment Due Date: The beginning of class on September 8, 017. The purpose of this assignment is to have you practice the mathematical skills necessary to be successful in Trigonometry.

More information

CS Rasterization. Junqiao Zhao 赵君峤

CS Rasterization. Junqiao Zhao 赵君峤 CS10101001 Rasterization Junqiao Zhao 赵君峤 Department of Computer Science and Technology College of Electronics and Information Engineering Tongji University Vector Graphics Algebraic equations describe

More information

Computer Graphics. - Rasterization - Philipp Slusallek

Computer Graphics. - Rasterization - Philipp Slusallek Computer Graphics - Rasterization - Philipp Slusallek Rasterization Definition Given some geometry (point, 2D line, circle, triangle, polygon, ), specify which pixels of a raster display each primitive

More information

Unit 2: Trigonometry. This lesson is not covered in your workbook. It is a review of trigonometry topics from previous courses.

Unit 2: Trigonometry. This lesson is not covered in your workbook. It is a review of trigonometry topics from previous courses. Unit 2: Trigonometry This lesson is not covered in your workbook. It is a review of trigonometry topics from previous courses. Pythagorean Theorem Recall that, for any right angled triangle, the square

More information

CS452/552; EE465/505. Geometry Transformations

CS452/552; EE465/505. Geometry Transformations CS452/552; EE465/505 Geometry Transformations 1-26-15 Outline! Geometry: scalars, points & vectors! Transformations Read: Angel, Chapter 4 (study cube.html/cube.js example) Appendix B: Spaces (vector,

More information

Line Drawing. Foundations of Computer Graphics Torsten Möller

Line Drawing. Foundations of Computer Graphics Torsten Möller Line Drawing Foundations of Computer Graphics Torsten Möller Rendering Pipeline Hardware Modelling Transform Visibility Illumination + Shading Perception, Interaction Color Texture/ Realism Reading Angel

More information

Moore Catholic High School Math Department

Moore Catholic High School Math Department Moore Catholic High School Math Department Geometry Vocabulary The following is a list of terms and properties which are necessary for success in a Geometry class. You will be tested on these terms during

More information

UNIT 5 TRIGONOMETRY Lesson 5.4: Calculating Sine, Cosine, and Tangent. Instruction. Guided Practice 5.4. Example 1

UNIT 5 TRIGONOMETRY Lesson 5.4: Calculating Sine, Cosine, and Tangent. Instruction. Guided Practice 5.4. Example 1 Lesson : Calculating Sine, Cosine, and Tangent Guided Practice Example 1 Leo is building a concrete pathway 150 feet long across a rectangular courtyard, as shown in the following figure. What is the length

More information

Einführung in Visual Computing

Einführung in Visual Computing Einführung in Visual Computing 186.822 Rasterization Werner Purgathofer Rasterization in the Rendering Pipeline scene objects in object space transformed vertices in clip space scene in normalized device

More information

Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática. Chap. 2 Rasterization.

Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática. Chap. 2 Rasterization. Tópicos de Computação Gráfica Topics in Computer Graphics 10509: Doutoramento em Engenharia Informática Chap. 2 Rasterization Rasterization Outline : Raster display technology. Basic concepts: pixel, resolution,

More information

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52

C O M P U T E R G R A P H I C S. Computer Graphics. Three-Dimensional Graphics I. Guoying Zhao 1 / 52 Computer Graphics Three-Dimensional Graphics I Guoying Zhao 1 / 52 Geometry Guoying Zhao 2 / 52 Objectives Introduce the elements of geometry Scalars Vectors Points Develop mathematical operations among

More information

YEAR 10- Mathematics Term 1 plan

YEAR 10- Mathematics Term 1 plan Week YEAR 10- Mathematics Term 1 plan 2016-2017 Course Objectives 1 The number system To understand and use 4 rules and order of operation. To understand and use Recurring decimals. Add subtract multiply

More information

Computer Graphics D Graphics Algorithms

Computer Graphics D Graphics Algorithms Computer Graphics 2015 2. 2D Graphics Algorithms Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2015-09-21 Screen - Linear Structure Nikon D40 Sensors 3 RGBW Camera Sensor RGBW Camera Sensor

More information

Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling

Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling Computer Graphics : Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling Downloaded from :www.comp.dit.ie/bmacnamee/materials/graphics/006- Contents In today s lecture we ll have a loo at:

More information

Painter s HSR Algorithm

Painter s HSR Algorithm Painter s HSR Algorithm Render polygons farthest to nearest Similar to painter layers oil paint Viewer sees B behind A Render B then A Depth Sort Requires sorting polygons (based on depth) O(n log n) complexity

More information

Digital Differential Analyzer Bresenhams Line Drawing Algorithm

Digital Differential Analyzer Bresenhams Line Drawing Algorithm Bresenham s Line Generation The Bresenham algorithm is another incremental scan conversion algorithm. The big advantage of this algorithm is that, it uses only integer calculations. Difference Between

More information

Topic #1: Rasterization (Scan Conversion)

Topic #1: Rasterization (Scan Conversion) Topic #1: Rasterization (Scan Conversion) We will generally model objects with geometric primitives points, lines, and polygons For display, we need to convert them to pixels for points it s obvious but

More information

Look up partial Decomposition to use for problems #65-67 Do Not solve problems #78,79

Look up partial Decomposition to use for problems #65-67 Do Not solve problems #78,79 Franklin Township Summer Assignment 2017 AP calculus AB Summer assignment Students should use the Mathematics summer assignment to identify subject areas that need attention in preparation for the study

More information

CS 130 Final. Fall 2015

CS 130 Final. Fall 2015 CS 130 Final Fall 2015 Name Student ID Signature You may not ask any questions during the test. If you believe that there is something wrong with a question, write down what you think the question is trying

More information

A trigonometric ratio is a,

A trigonometric ratio is a, ALGEBRA II Chapter 13 Notes The word trigonometry is derived from the ancient Greek language and means measurement of triangles. Section 13.1 Right-Triangle Trigonometry Objectives: 1. Find the trigonometric

More information

What You ll See in This Chapter. Word Cloud. René Descartes. Introduction. Ian Parberry University of North Texas. Fletcher Dunn

What You ll See in This Chapter. Word Cloud. René Descartes. Introduction. Ian Parberry University of North Texas. Fletcher Dunn What You ll See in This Chapter Chapter 1: Cartesian Coordinate Systems Fletcher Dunn Valve Software Ian Parberry University of North Texas This chapter describes the basic concepts of 3D math. It is divided

More information

Algebra II. Slide 1 / 162. Slide 2 / 162. Slide 3 / 162. Trigonometric Functions. Trig Functions

Algebra II. Slide 1 / 162. Slide 2 / 162. Slide 3 / 162. Trigonometric Functions. Trig Functions Slide 1 / 162 Algebra II Slide 2 / 162 Trigonometric Functions 2015-12-17 www.njctl.org Trig Functions click on the topic to go to that section Slide 3 / 162 Radians & Degrees & Co-terminal angles Arc

More information

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space

Basic Elements. Geometry is the study of the relationships among objects in an n-dimensional space Basic Elements Geometry is the study of the relationships among objects in an n-dimensional space In computer graphics, we are interested in objects that exist in three dimensions We want a minimum set

More information

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller

Line Drawing. Introduction to Computer Graphics Torsten Möller / Mike Phillips. Machiraju/Zhang/Möller Line Drawing Introduction to Computer Graphics Torsten Möller / Mike Phillips Rendering Pipeline Hardware Modelling Transform Visibility Illumination + Shading Perception, Color Interaction Texture/ Realism

More information

CS 4300 Computer Graphics. Prof. Harriet Fell Fall 2012 Lecture 5 September 13, 2012

CS 4300 Computer Graphics. Prof. Harriet Fell Fall 2012 Lecture 5 September 13, 2012 CS 4300 Computer Graphics Prof. Harriet Fell Fall 2012 Lecture 5 September 13, 2012 1 Today s Topics Vectors review Shirley et al. 2.4 Rasters Shirley et al. 3.0-3.2.1 Rasterizing Lines Shirley et al.

More information

High School Geometry

High School Geometry High School Geometry This course covers the topics shown below. Students navigate learning paths based on their level of readiness. Institutional users may customize the scope and sequence to meet curricular

More information

An Improved Algorithm for Scan-converting a Line

An Improved Algorithm for Scan-converting a Line An Improved Algorithm for Scan-converting a Line *Md. Hasanul Kabir 1, Md. Imrul Hassan 2, Abdullah Azfar 1 1 Department of Computer Science & Information Technology (CIT) 2 Department of Electrical &

More information

MATHEMATICS FOR ENGINEERING TRIGONOMETRY

MATHEMATICS FOR ENGINEERING TRIGONOMETRY MATHEMATICS FOR ENGINEERING TRIGONOMETRY TUTORIAL SOME MORE RULES OF TRIGONOMETRY This is the one of a series of basic tutorials in mathematics aimed at beginners or anyone wanting to refresh themselves

More information

AQA GCSE Further Maths Topic Areas

AQA GCSE Further Maths Topic Areas AQA GCSE Further Maths Topic Areas This document covers all the specific areas of the AQA GCSE Further Maths course, your job is to review all the topic areas, answering the questions if you feel you need

More information

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines COMP30019 Graphics and Interaction Scan Converting Polygons and Lines Department of Computer Science and Software Engineering The Lecture outline Introduction Scan conversion Scan-line algorithm Edge coherence

More information

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves

0. Introduction: What is Computer Graphics? 1. Basics of scan conversion (line drawing) 2. Representing 2D curves CSC 418/2504: Computer Graphics Course web site (includes course information sheet): http://www.dgp.toronto.edu/~elf Instructor: Eugene Fiume Office: BA 5266 Phone: 416 978 5472 (not a reliable way) Email:

More information

Chapter 4: Trigonometry

Chapter 4: Trigonometry Chapter 4: Trigonometry Section 4-1: Radian and Degree Measure INTRODUCTION An angle is determined by rotating a ray about its endpoint. The starting position of the ray is the of the angle, and the position

More information

Efficient Plotting Algorithm

Efficient Plotting Algorithm Efficient Plotting Algorithm Sushant Ipte 1, Riddhi Agarwal 1, Murtuza Barodawala 1, Ravindra Gupta 1, Prof. Shiburaj Pappu 1 Computer Department, Rizvi College of Engineering, Mumbai, Maharashtra, India

More information

Rasterization. CS4620/5620: Lecture 12. Announcements. Turn in HW 1. PPA 1 out. Friday lecture. History of graphics PPA 1 in 4621.

Rasterization. CS4620/5620: Lecture 12. Announcements. Turn in HW 1. PPA 1 out. Friday lecture. History of graphics PPA 1 in 4621. CS4620/5620: Lecture 12 Rasterization 1 Announcements Turn in HW 1 PPA 1 out Friday lecture History of graphics PPA 1 in 4621 2 The graphics pipeline The standard approach to object-order graphics Many

More information

Trigonometry Review Day 1

Trigonometry Review Day 1 Name Trigonometry Review Day 1 Algebra II Rotations and Angle Terminology II Terminal y I Positive angles rotate in a counterclockwise direction. Reference Ray Negative angles rotate in a clockwise direction.

More information

Algebra II Trigonometric Functions

Algebra II Trigonometric Functions Slide 1 / 162 Slide 2 / 162 Algebra II Trigonometric Functions 2015-12-17 www.njctl.org Slide 3 / 162 Trig Functions click on the topic to go to that section Radians & Degrees & Co-terminal angles Arc

More information

A lg e b ra II. Trig o n o m e tric F u n c tio

A lg e b ra II. Trig o n o m e tric F u n c tio 1 A lg e b ra II Trig o n o m e tric F u n c tio 2015-12-17 www.njctl.org 2 Trig Functions click on the topic to go to that section Radians & Degrees & Co-terminal angles Arc Length & Area of a Sector

More information

Introduction to Computer Graphics (CS602) Lecture 05 Line Drawing Techniques

Introduction to Computer Graphics (CS602) Lecture 05 Line Drawing Techniques Introduction to Computer Graphics (CS602) Lecture 05 Line Drawing Techniques 5.1 Line A line, or straight line, is, roughly speaking, an (infinitely) thin, (infinitely) long, straight geometrical object,

More information

: Find the values of the six trigonometric functions for θ. Special Right Triangles:

: Find the values of the six trigonometric functions for θ. Special Right Triangles: ALGEBRA 2 CHAPTER 13 NOTES Section 13-1 Right Triangle Trig Understand and use trigonometric relationships of acute angles in triangles. 12.F.TF.3 CC.9- Determine side lengths of right triangles by using

More information

Chapter 11. Parametric Equations And Polar Coordinates

Chapter 11. Parametric Equations And Polar Coordinates Instructor: Prof. Dr. Ayman H. Sakka Chapter 11 Parametric Equations And Polar Coordinates In this chapter we study new ways to define curves in the plane, give geometric definitions of parabolas, ellipses,

More information

Jim Lambers MAT 169 Fall Semester Lecture 33 Notes

Jim Lambers MAT 169 Fall Semester Lecture 33 Notes Jim Lambers MAT 169 Fall Semester 2009-10 Lecture 33 Notes These notes correspond to Section 9.3 in the text. Polar Coordinates Throughout this course, we have denoted a point in the plane by an ordered

More information

TABLE 2: Mathematics College Readiness Standards for Score Range 13 15

TABLE 2: Mathematics College Readiness Standards for Score Range 13 15 TABLE 2: Mathematics College Readiness Standards for Score Range 13 15 Perform one-operation computation with whole numbers and decimals Solve problems in one or two steps using whole numbers Perform common

More information

Mastery. PRECALCULUS Student Learning Targets

Mastery. PRECALCULUS Student Learning Targets PRECALCULUS Student Learning Targets Big Idea: Sequences and Series 1. I can describe a sequence as a function where the domain is the set of natural numbers. Connections (Pictures, Vocabulary, Definitions,

More information

Catholic Central High School

Catholic Central High School Catholic Central High School Algebra II Practice Examination I Instructions: 1. Show all work on the test copy itself for every problem where work is required. Points may be deducted if insufficient or

More information

Trigonometric Ratios and Functions

Trigonometric Ratios and Functions Algebra 2/Trig Unit 8 Notes Packet Name: Date: Period: # Trigonometric Ratios and Functions (1) Worksheet (Pythagorean Theorem and Special Right Triangles) (2) Worksheet (Special Right Triangles) (3) Page

More information

Geometry. (F) analyze mathematical relationships to connect and communicate mathematical ideas; and

Geometry. (F) analyze mathematical relationships to connect and communicate mathematical ideas; and (1) Mathematical process standards. The student uses mathematical processes to acquire and demonstrate mathematical understanding. The student is (A) apply mathematics to problems arising in everyday life,

More information

CHAPTER 2 REVIEW COORDINATE GEOMETRY MATH Warm-Up: See Solved Homework questions. 2.2 Cartesian coordinate system

CHAPTER 2 REVIEW COORDINATE GEOMETRY MATH Warm-Up: See Solved Homework questions. 2.2 Cartesian coordinate system CHAPTER 2 REVIEW COORDINATE GEOMETRY MATH6 2.1 Warm-Up: See Solved Homework questions 2.2 Cartesian coordinate system Coordinate axes: Two perpendicular lines that intersect at the origin O on each line.

More information

ALGEBRA II A CURRICULUM OUTLINE

ALGEBRA II A CURRICULUM OUTLINE ALGEBRA II A CURRICULUM OUTLINE 2013-2014 OVERVIEW: 1. Linear Equations and Inequalities 2. Polynomial Expressions and Equations 3. Rational Expressions and Equations 4. Radical Expressions and Equations

More information

Multivariable Calculus

Multivariable Calculus Multivariable Calculus Chapter 10 Topics in Analytic Geometry (Optional) 1. Inclination of a line p. 5. Circles p. 4 9. Determining Conic Type p. 13. Angle between lines p. 6. Parabolas p. 5 10. Rotation

More information

Scan Converting Lines

Scan Converting Lines Scan Conversion 1 Scan Converting Lines Line Drawing Draw a line on a raster screen between two points What s wrong with the statement of the problem? it doesn t say anything about which points are allowed

More information

Problems of Plane analytic geometry

Problems of Plane analytic geometry 1) Consider the vectors u(16, 1) and v( 1, 1). Find out a vector w perpendicular (orthogonal) to v and verifies u w = 0. 2) Consider the vectors u( 6, p) and v(10, 2). Find out the value(s) of parameter

More information

FORMULAS to UNDERSTAND & MEMORIZE

FORMULAS to UNDERSTAND & MEMORIZE 1 of 6 FORMULAS to UNDERSTAND & MEMORIZE Now we come to the part where you need to just bear down and memorize. To make the process a bit simpler, I am providing all of the key info that they re going

More information

Trigonometric Functions of Any Angle

Trigonometric Functions of Any Angle Trigonometric Functions of Any Angle MATH 160, Precalculus J. Robert Buchanan Department of Mathematics Fall 2011 Objectives In this lesson we will learn to: evaluate trigonometric functions of any angle,

More information

Topic 0. Introduction: What Is Computer Graphics? CSC 418/2504: Computer Graphics EF432. Today s Topics. What is Computer Graphics?

Topic 0. Introduction: What Is Computer Graphics? CSC 418/2504: Computer Graphics EF432. Today s Topics. What is Computer Graphics? EF432 Introduction to spagetti and meatballs CSC 418/2504: Computer Graphics Course web site (includes course information sheet): http://www.dgp.toronto.edu/~karan/courses/418/ Instructors: L0101, W 12-2pm

More information

Computer Graphics D Graphics Algorithms

Computer Graphics D Graphics Algorithms ! Computer Graphics 2014! 2. 2D Graphics Algorithms Hongxin Zhang State Key Lab of CAD&CG, Zhejiang University 2014-09-26! Screen Nikon D40 Sensors 3 Rasterization - The task of displaying a world modeled

More information

Scan Conversion. Lines and Circles

Scan Conversion. Lines and Circles Scan Conversion Lines and Circles (Chapter 3 in Foley & Van Dam) 2D Line Implicit representation: αx + βy + γ = 0 Explicit representation: y y = mx+ B m= x Parametric representation: x P= y P = t y P +

More information

Use of Number Maths Statement Code no: 1 Student: Class: At Junior Certificate level the student can: Apply the knowledge and skills necessary to perf

Use of Number Maths Statement Code no: 1 Student: Class: At Junior Certificate level the student can: Apply the knowledge and skills necessary to perf Use of Number Statement Code no: 1 Apply the knowledge and skills necessary to perform mathematical calculations 1 Recognise simple fractions, for example 1 /4, 1 /2, 3 /4 shown in picture or numerical

More information

College Technical Mathematics 1

College Technical Mathematics 1 Lakeshore Technical College 10-804-115 College Technical Mathematics 1 Course Outcome Summary Course Information Alternate Title College Technical Math 1 Description Total Credits 5 Total Hours 108...prepares

More information

CS 450: COMPUTER GRAPHICS RASTERIZING LINES SPRING 2016 DR. MICHAEL J. REALE

CS 450: COMPUTER GRAPHICS RASTERIZING LINES SPRING 2016 DR. MICHAEL J. REALE CS 45: COMPUTER GRAPHICS RASTERIZING LINES SPRING 6 DR. MICHAEL J. REALE OBJECT-ORDER RENDERING We going to start on how we will perform object-order rendering Object-order rendering Go through each OBJECT

More information

LIGHT: Two-slit Interference

LIGHT: Two-slit Interference LIGHT: Two-slit Interference Objective: To study interference of light waves and verify the wave nature of light. Apparatus: Two red lasers (wavelength, λ = 633 nm); two orange lasers (λ = 612 nm); two

More information

Renderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005

Renderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005 INSTITUTIONEN FÖR SYSTEMTEKNIK LULEÅ TEKNISKA UNIVERSITET Renderer Implementation: Basics and Clipping David Carr Virtual Environments, Fundamentals Spring 2005 Feb-28-05 SMM009, Basics and Clipping 1

More information

Computer Graphics Lecture 5

Computer Graphics Lecture 5 1 / 25 Computer Graphics Lecture 5 Dr. Marc Eduard Frîncu West University of Timisoara Mar 27th 2012 2 / 25 Outline 1 Graphical Primitives Drawing Surfaces 2 Assignment 3 Recap 3 / 25 Graphical Primitives

More information