Computer Graphics. Lecture 3 Graphics Output Primitives. Somsak Walairacht, Computer Engineering, KMITL

Size: px
Start display at page:

Download "Computer Graphics. Lecture 3 Graphics Output Primitives. Somsak Walairacht, Computer Engineering, KMITL"

Transcription

1 Computer Graphics Lecture 3 Graphics Output Primitives Somsa Walairacht, Computer Engineering, KMITL

2 Outline Line Drawing Algorithms Circle-, Ellipse-Generating Algorithms Fill-Area Primitives Polgon Fill Area Piel-Arra Primitives Character Primitives Computer Graphics

3 Line Drawing Algorithms Line Properties DDA Algorithm Bresenham s Line Algorithm Curve Properties Midpoint Algorithm Computer Graphics 3

4 A Straight-Line Segment Defined b the coordinate positions for the endpoints of the segment Graphics sstem projects the endpoints to integer screen coordinates and determine the nearest piel positions along the line path between the two endpoints A computed line position of (0.48, 0.5 is converted to piel position (0, It causes all but horizontal and vertical lines to be displaed with a stair-step appearance ( the jaggies Computer Graphics 4

5 OpenGL output functions glbegin(gl_lines; // Specif what to draw, // here lines // Geometric info via vertices: glverte*(; // glverte*(; //... //... glend; * glverte[34][isfd] [34]: D, 3D, 4D [isfd]: integer, short, float, double For instance: glvertei(00, 5; H&B 4-4:8-8

6 Point and Line primitives 3 4 GL_POINTS: sequence of points GL_LINES: sequence of line segments GL_LINE_STRIP: polline GL_LINE_LOOP: closed polline H&B 4-4:8-8

7 . Line Properties Line Equations Cartesian slope-intercept equation = m + b With specific to a line with ( 0, 0 and ( end, end m Given interval d, interval d can be found b Similarl end end d md d d m 0 0 b 0 m 0 Computer Graphics 7

8 Lines & Slopes The slope of a line (m is defined b its start and end coordinates The diagram below shows some eamples of lines and their slopes m = -4 m = - m = m = 4 m = m = - m = m = - / m = - / 3 m = / m = / 3 m = 0 m = 0 Computer Graphics 8

9 Scan-conversion Process for Straight Lines For lines with slope magnitude < : d can be set proportional to horizontal position, d can be calculated from d=m(d For lines with slope magnitude > : d can be set proportional to vertical position, d can be calculated from d=d/m Slope magnitude = : d=d m = m = m = m = / 3 m = 0 Computer Graphics 9

10 Eample 4 5 (7, 5 First wor out m and b: 3 (, m b b 0 m 0 Now for each value wor out the value: 3 4 ( ( ( ( Computer Graphics 0

11 Eample (cont Now just round off the results and turn on these piels to draw our line ( 3 5 ( ( ( Computer Graphics

12 . DDA Algorithm Digital Differential Analzer (DDA Scan-conversion line algorithm Based on calculating either d or d A line is sampled at unit intervals in one coordinate and the corresponding values nearest to line path are determined for the other coordinate Computer Graphics

13 DDA ( ความช นของเส นตรงม ค าเป นบวก The line is processed from left endpoint to right endpoint Slope is less than or equal to d =, + = + m Slope is greater than d =, + = + /m The line is processed from right endpoint to left endpoint Slope is less than or equal to d = -, + = -m Slope is greater than d = -, + = -/m ความช นของเส นตรงม ค าเป นลบ The line is processed from left endpoint to right endpoint Abs of slope is less than d = +, + = - m Abs of slope is greater than d = -, + = + / m The line is processed from right endpoint to left endpoint Abs of slope is less than d = -, + = + m Abs of slope is greater than d = +, + = - / m Computer Graphics 3

14 Sample Code inline int round (const float a { return int (a + 0.5; } void linedda (int 0, int 0, int End, int End { int d = End - 0, d = End - 0, steps, ; float Increment, Increment, = 0, = 0; if (fabs (d > fabs (d steps = fabs (d; else steps = fabs (d; Increment = float (d / float (steps; Increment = float (d / float (steps; setpiel (round (, round (; for ( = 0; < steps; ++ { += Increment; += Increment; setpiel (round (, round (; } } Computer Graphics 4

15 DDA (3 Fast method Accumulation of round-off errors can cause piel position to drift awa from the true line path for long segment Rounding operation and floating-point arithmetic are epensive Computer Graphics 5

16 Integer DDA ให d = end - start, d = end - start ให = abs(d, = abs(d, และ error = - พ จารณาได 4 กรณ 0<m< และ d, d เป นบวก error เป นลบ เล อกจ ด E แล ว error = error+ error เป นบวก หร อ=ศ นย เล อกจ ด NE แล ว error = error+- m> และ d, d เป นบวก error เป นลบ หร อ=ศ นย เล อกจ ด NE แล ว error = error+- error เป นบวก เล อกจ ด N แล ว error = error- -<m<0 และ d เป นลบ d เป นบวก error เป นลบ เล อกจ ด W แล ว error = error+ error เป นบวก หร อ=ศ นย เล อกจ ด NW แล ว error = error+- m<- และ d เป นลบ d เป นบวก error เป นลบ หร อ=ศ นย เล อกจ ด NW แล ว error = error+- error เป นบวก เล อกจ ด N แล ว error = error- Computer Graphics 6

17 Integer DDA ( Eample (,=(, (,=(0, ล าด บท Error เด ม จ ดป จจ บ น จ ดถ ดไป Error ใหม,,3-4=-3-3,3 3, =- 3-3,4 4, =- 4-4,5 5, = ,6 6, = 6 6,7 6,8-4= ,8 7, =- 8-7,9 8, =- 9-8,0 9, -+5-4= , 0, 0+5-4= Computer Graphics 7

18 4. Bresenham s Line Algorithm Accurate and efficient raster-line generating algorithm Onl use integer for calculations Determine the nearest piel position to the line B using the sign of integer parameter Parameter is proportional to the difference between the vertical separation of the two piel positions from the actual line path Computer Graphics 8

19 Bresenham s Line Algorithm ( Reference for Bresenham s Line Algorithm Computer Graphics 9

20 Bresenham s Line Algorithm (3 Proving Bresenham s Line Algorithm Find distance between the line to the upper and lower piels d d lower upper ( m( b m( b Find the difference between two piel, to determine which one is closest to the path d lower d upper m( b Computer Graphics 0

21 Computer Graphics Bresenham s Line Algorithm (4 To convert the parameter to an integer For and + Since + = + Starting point ( 0, 0 and m=d/d ( ( p p ( p p p p ( ( ( ( c d d p upper lower ( ( ( ( b c 0 0 b b m ] ( ( [ ( ( c c p p

22 Bresenham s Line Algorithm (5 p p ( Note: For a line with positive slope >.0, interchange the roles of the and directions Computer Graphics

23 Bresenham s Line Algorithm (6 Computer Graphics 3

24 OpenGL Curve Functions Routines for generating basic curves are not included in OpenGL core librar GLU has routines for 3D Quadrics, such as spheres, clinders, B-splines Simple curve can be approimated using a polline Computer Graphics 4

25 Circle-Generating Algorithms Properties of Circles Pthagorean Theorem ( c ( c r Stepping along from c -r to c +r and calculate Epressing circle equation in polar form r cos r cos Smmetr of circle c c c r ( c Computer Graphics 5

26 Computer Graphics 6 Curves Properties Properties of Ellipses Ellipse equation Epressing ellipse equation in polar form Other curves Parabolic trajector Hperbola ( ( o o o b a ( ( c c r r cos cos r r c c ( ( r r

27 A Simple Circle Drawing Algorithm c r ( c Computer Graphics 7

28 Midpoint Circle Algorithm Midpoint Algorithm Useful in drawing curves Determine the closest piel to the curve path b using the midpoint between two candidate piels Eample, midpoint at + along a circular path Computer Graphics 8

29 Midpoint Circle Algorithm ( Eample: Midpoint Circle Algorithm Define circle function as f circ (, r B putting a point ( o, o into the circle function ( o, o is in the circle boundar, if f circ < 0 ( o, o is on the circle boundar, if f circ = 0 ( o, o is outside the circle boundar, if f circ > 0 Decision parameter can be evaluated from the circle function at the midpoint p fcirc(, Computer Graphics 9

30 Computer Graphics 30 Midpoint Circle Algorithm (3 Successive decision parameters, + + = + + is either or - depending on the sign of p When =+, if p < 0, plot ( +, and use Eq. if p > 0, plot ( +, - and use Eq. ( ( (, ( circ p f p...(...( p p p p

31 Midpoint Circle Algorithm (4 Computer Graphics 3

32 Midpoint Circle Algorithm (5 Given a circle radius r=0 Computer Graphics 3

33 Fill-Area Primitives Area filled with solid color or pattern Most graphics require a fill area be a polgon Curved surfaces can be approimated with a set of polgon patches Sometimes called as surface tessellation Computer Graphics 38

34 Polgon A polgon is a plane figure specified b a set of three or more coordinate positions, called vertices A polgon must have all its vertices within a single plane and there can be no edge crossings To avoid ambiguous object references, polgon refers onl to those planar shapes that have a closed-polline boundar and no edge crossings Computer Graphics 39

35 Conve vs. Concave Conve : All interior angles < 80 degree, and All line segments between interior points in polgon, and All points at the same side of line through edge, and From each interior point complete boundar visible Concave : not conve H&B 4-7:84-94

36 Identifing Concave Polgons A concave polgon has at least one interior angle greater than 80 Etension of some edges intersect other edges Line segment b a pair of interior points intersects the polgon boundar The cross product of adjacent edges is used to test for concavit Computer Graphics 4

37 Splitting Concave Polgons Using edge vectors and edge cross products If an cross product has a negative z, we can split it along the line of the first edge vector in the cross-product pair Computer Graphics 4

38 Splitting Concave Polgons ( Using a rotational method Proceeding counterclocwise around the polgon edges, shift the position of the polgon so that each verte V in turn is at the coordinate origin Rotate the polgon about the origin in a clocwise direction so that the net verte V + is on the -ais Computer Graphics 43

39 Splitting Concave Polgons (3 If the following verte, V +, is below the -ais, then split the polgon along the - ais Steps are repeated until all vertices in the polgon list are tested Computer Graphics 44

40 Splitting a Conve Polgon into a Set of Triangles Defining an sequence of 3 consecutive vertices to be a new polgon (a triangle The middle triangle verte is then deleted from the original verte list Repeat until the original polgon is reduced to just three vertices Computer Graphics 45

41 Inside-Outside Tests Odd-even rule, also called the odd-parit rule or the even-odd rule Identifing interior areas of a plane figure Drawing a line from an position P to a distant point outside the coordinate etents of the closed polline Then count the number of line-segment crossings along this line Odd=interior, otherwise = eterior Computer Graphics 46

42 Inside-Outside Tests ( Nonzero winding-number rule Counts the number of times the boundar of an object winds around a particular point in the counterclocwise direction The interior points of a D object can be defined b having a nonzero value for the winding number Nonzero = interior, otherwise = eterior Computer Graphics 47

43 Nonzero Winding-Number Rule Mechanism Initializing the winding number to 0 A line drawn from an position P to a distant point beond the coordinate etents of the object Count the number of object line segments that cross the reference line in each direction Add when intersects a segment that crosses from right to left (counterclocwise Subtract when intersects a segment that crosses from left to right (clocwise Computer Graphics 48

44 Variations of the Nonzero Winding-Number Rule Border direction Winding number Add (counterclocwise Subtract (clocwise Computer Graphics 49

45 Polgon Tables Objects in scene are described as a set of polgon surface facets Geometric data for objects in scene are arranged in Verte table, store the coordinate value of verte Edge table, contains pointers bac into the verte table to identif the vertices for each polgon edge Surface-facet table, contains pointers bac into the edge table to identif the edge for each polgon edge Edge table can be epanded to include forward pointers into the surface-facet table Computer Graphics 50

46 Polgon Tables ( Polgon table for two adjacent polgon surface facets Convenient reference Object can be displaed efficientl Computer Graphics 5

47 Polgon Tables (3 Tables can be organized into two groups: geometric tables and attribute tables Geometric tables contain verte coordinates and parameters to identif the spatial orientation of the polgon surfaces Attribute tables specif the degree of transparenc of the object and its surface reflectivit and teture characteristics Somsa Computer Walairacht, Graphics Computer Engineering, KMITL 5

48 Computer Graphics 59 Plane Properties General equation of a plane Use Cramer s rule to compute polgon facets data Distance from a point to a plane Front and bac polgon faces Bac face, side of polgon faces into the object interior Front face, the visible or outward side 0 d cz b a ,,, z z z D D d c z z z D d b z z z D d a Distance,, ( 0, c b a d cz b a z p d cz b a d cz b a d cz b a d cz b a

49 Plane Properties ( Identif a point behind or in front of a polgon surface Put the point into the plane equation if A + B + Cz +D < 0, the point (,,z is behind the plane if A + B + Cz +D > 0, the point (,,z is in front of the plane Orientation of a polgon surface in space, described b normal vector Computer Graphics 60

50 End of Lecture 3 Computer Graphics 8

Graphics Output Primitives

Graphics Output Primitives Important Graphics Output Primitives Graphics Output Primitives in 2D polgons, circles, ellipses & other curves piel arra operations in 3D triangles & other polgons Werner Purgathofer / Computergraphik

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

OUTPUT PRIMITIVES. CEng 477 Introduction to Computer Graphics METU, 2007

OUTPUT PRIMITIVES. CEng 477 Introduction to Computer Graphics METU, 2007 OUTPUT PRIMITIVES CEng 477 Introduction to Computer Graphics METU, 007 Recap: The basic forward projection pipeline: MCS Model Model Modeling Transformations M M 3D World Scene Viewing Transformations

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

Computer Graphics. Modelling in 2D. 2D primitives. Lines and Polylines. OpenGL polygon primitives. Special polygons

Computer Graphics. Modelling in 2D. 2D primitives. Lines and Polylines. OpenGL polygon primitives. Special polygons Computer Graphics Modelling in D Lecture School of EECS Queen Mar, Universit of London D primitives Digital line algorithms Digital circle algorithms Polgon filling CG - p.hao@qmul.ac.uk D primitives Line

More information

CSC Computer Graphics

CSC Computer Graphics 7//7 CSC. Computer Graphics Lecture Kasun@dscs.sjp.ac.l Department of Computer Science Universit of Sri Jaewardanepura Line drawing algorithms DDA Midpoint (Bresenham s) Algorithm Circle drawing algorithms

More information

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

CS 548: COMPUTER GRAPHICS DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE CS 548: COMPUTER GRAPHICS DRAWING LINES AND CIRCLES SPRING 05 DR. MICHAEL J. REALE OPENGL POINTS AND LINES OPENGL POINTS AND LINES In OenGL, there are different constants used to indicate what ind of rimitive

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

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

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

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

Prof. Feng Liu. Fall /25/2018

Prof. Feng Liu. Fall /25/2018 Prof. Feng Liu Fall 08 http://www.cs.pd.edu/~fliu/courses/cs7/ 0/5/08 Last time Clipping Toda Rasterization In-class Mid-term November Close-book eam Notes on page of A or Letter size paper Where We Stand

More information

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1 Toda s class Geometric objects and transformations Wednesda, November 7, 27 Computer Graphics - Class 5 Vector operations Review of vector operations needed for working in computer graphics adding two

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

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 (Output) Primitives. Chapters 3 & 4

Graphics (Output) Primitives. Chapters 3 & 4 Graphics (Output) Primitives Chapters 3 & 4 Graphic Output and Input Pipeline Scan conversion converts primitives such as lines, circles, etc. into pixel values geometric description a finite scene area

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

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

Reteaching Golden Ratio

Reteaching Golden Ratio Name Date Class Golden Ratio INV 11 You have investigated fractals. Now ou will investigate the golden ratio. The Golden Ratio in Line Segments The golden ratio is the irrational number 1 5. c On the line

More information

Chapter 3: Graphics Output Primitives. OpenGL Line Functions. OpenGL Point Functions. Line Drawing Algorithms

Chapter 3: Graphics Output Primitives. OpenGL Line Functions. OpenGL Point Functions. Line Drawing Algorithms Chater : Grahics Outut Primitives Primitives: functions in grahics acage that we use to describe icture element Points and straight lines are the simlest rimitives Some acages include circles, conic sections,

More information

Glossary alternate interior angles absolute value function Example alternate exterior angles Example angle of rotation Example

Glossary alternate interior angles absolute value function Example alternate exterior angles Example angle of rotation Example Glossar A absolute value function An absolute value function is a function that can be written in the form, where is an number or epression. alternate eterior angles alternate interior angles Alternate

More information

2D Graphics Primitives II. Additional issues in scan converting lines. 1)Endpoint order. Want algorithms to draw the same pixels for each line

2D Graphics Primitives II. Additional issues in scan converting lines. 1)Endpoint order. Want algorithms to draw the same pixels for each line walters@buffalo.edu CSE 480/580 Lecture 8 Slide 1 2D Graphics Primitives II Additional issues in scan converting lines 1)Endpoint order Want algorithms to draw the same pixels for each line How handle?

More information

UNIT 2 GRAPHIC PRIMITIVES

UNIT 2 GRAPHIC PRIMITIVES UNIT 2 GRAPHIC PRIMITIVES Structure Page Nos. 2.1 Introduction 46 2.2 Objectives 46 2.3 Points and Lines 46 2.4 Line Generation Algorithms 48 2.4.1 DDA Algorithm 49 2.4.2 Bresenhams Line Generation Algorithm

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

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

Two Dimensional Viewing

Two Dimensional Viewing Two Dimensional Viewing Dr. S.M. Malaek Assistant: M. Younesi Two Dimensional Viewing Basic Interactive Programming Basic Interactive Programming User controls contents, structure, and appearance of objects

More information

Raster Displays and Scan Conversion. Computer Graphics, CSCD18 Fall 2008 Instructor: Leonid Sigal

Raster Displays and Scan Conversion. Computer Graphics, CSCD18 Fall 2008 Instructor: Leonid Sigal Raster Displays and Scan Conversion Computer Graphics, CSCD18 Fall 28 Instructor: Leonid Sigal Rater Displays Screen is represented by 2D array of locations called piels y Rater Displays Screen is represented

More information

Chapter 3. Sukhwinder Singh

Chapter 3. Sukhwinder Singh Chapter 3 Sukhwinder Singh PIXEL ADDRESSING AND OBJECT GEOMETRY Object descriptions are given in a world reference frame, chosen to suit a particular application, and input world coordinates are ultimately

More information

Midterm Review. Wen-Chieh (Steve) Lin Department of Computer Science

Midterm Review. Wen-Chieh (Steve) Lin Department of Computer Science Midterm Review Wen-Chieh (Steve) Lin Department of Computer Science Administration Assignment due on /3 :59 PM Midterm eam on /6 (Monda) Lecture slides Chapter 3 ecluding 3.6 & 3.8 Chapter 6, 7, 8 Chapter

More information

Computer Graphics. Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1

Computer Graphics. Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1 Computer Graphics Chapter 4 Attributes of Graphics Primitives Somsak Walairacht, Computer Engineering, KMITL 1 Outline OpenGL State Variables Point Attributes t Line Attributes Fill-Area Attributes Scan-Line

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

MODULE - 4. e-pg Pathshala

MODULE - 4. e-pg Pathshala e-pg Pathshala MODULE - 4 Subject : Computer Science Paper: Computer Graphics and Visualization Module: Midpoint Circle Drawing Procedure Module No: CS/CGV/4 Quadrant 1 e-text Before going into the Midpoint

More information

= = The number system. Module. Glossary Math Tools... 33

= = The number system. Module. Glossary Math Tools... 33 - > + > < - %. < + a = - = = b in. F - - Module The number sstem Lesson Rational and Irrational Numbers........ 8.NS. Lesson ompare and Order Numbers......... 8 8.NS., 8.NS. Lesson Estimate the Value of

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

Computer Graphics. Chapter 3 Computer Graphics Software

Computer Graphics. Chapter 3 Computer Graphics Software Computer Graphics Chapter 3 Computer Graphics Software Outline Graphics Software Packages Introduction to OpenGL Example Program 2 3 Graphics Software Software packages General Programming Graphics Packages

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

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

Three-Dimensional Coordinates

Three-Dimensional Coordinates CHAPTER Three-Dimensional Coordinates Three-dimensional movies superimpose two slightl different images, letting viewers with polaried eeglasses perceive depth (the third dimension) on a two-dimensional

More information

In today s lecture we ll have a look at: A simple technique The mid-point circle algorithm

In today s lecture we ll have a look at: A simple technique The mid-point circle algorithm Drawing Circles In today s lecture we ll have a look at: Circle drawing algorithms A simple technique The mid-point circle algorithm Polygon fill algorithms Summary raster drawing algorithms A Simple Circle

More information

8.6 Three-Dimensional Cartesian Coordinate System

8.6 Three-Dimensional Cartesian Coordinate System SECTION 8.6 Three-Dimensional Cartesian Coordinate Sstem 69 What ou ll learn about Three-Dimensional Cartesian Coordinates Distance and Midpoint Formulas Equation of a Sphere Planes and Other Surfaces

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

COMP371 COMPUTER GRAPHICS

COMP371 COMPUTER GRAPHICS COMP371 COMPUTER GRAPHICS LECTURE 14 RASTERIZATION 1 Lecture Overview Review of last class Line Scan conversion Polygon Scan conversion Antialiasing 2 Rasterization The raster display is a matrix of picture

More information

Unit 2 Output Primitives and their Attributes

Unit 2 Output Primitives and their Attributes Unit 2 Output Primitives and their Attributes Shapes and colors of the objects can be described internally with pixel arrays or with sets of basic geometric structures, such as straight line segments and

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

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

CS 543: Computer Graphics. Rasterization

CS 543: Computer Graphics. Rasterization CS 543: Computer Graphics Rasterization Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Polytechnic Institute gogo@wpi.edu (with lots

More information

Computer Graphics (CS 543) Lecture 10: Rasterization and Antialiasing

Computer Graphics (CS 543) Lecture 10: Rasterization and Antialiasing Computer Graphics (CS 543) Lecture 10: Rasterization and Antialiasing Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) Recall: Rasterization Rasterization (scan conversion)

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

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

Using Characteristics of a Quadratic Function to Describe Its Graph. The graphs of quadratic functions can be described using key characteristics:

Using Characteristics of a Quadratic Function to Describe Its Graph. The graphs of quadratic functions can be described using key characteristics: Chapter Summar Ke Terms standard form of a quadratic function (.1) factored form of a quadratic function (.1) verte form of a quadratic function (.1) concavit of a parabola (.1) reference points (.) transformation

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

2D Drawing Primitives

2D Drawing Primitives THE SIERPINSKI GASKET We use as a sample problem the drawing of the Sierpinski gasket an interesting shape that has a long history and is of interest in areas such as fractal geometry. The Sierpinski gasket

More information

5 and Parallel and Perpendicular Lines

5 and Parallel and Perpendicular Lines Ch 3: Parallel and Perpendicular Lines 3 1 Properties of Parallel Lines 3 Proving Lines Parallel 3 3 Parallel and Perpendicular Lines 3 Parallel Lines and the Triangle Angles Sum Theorem 3 5 The Polgon

More information

0 COORDINATE GEOMETRY

0 COORDINATE GEOMETRY 0 COORDINATE GEOMETRY Coordinate Geometr 0-1 Equations of Lines 0- Parallel and Perpendicular Lines 0- Intersecting Lines 0- Midpoints, Distance Formula, Segment Lengths 0- Equations of Circles 0-6 Problem

More information

10.2: Parabolas. Chapter 10: Conic Sections. Conic sections are plane figures formed by the intersection of a double-napped cone and a plane.

10.2: Parabolas. Chapter 10: Conic Sections. Conic sections are plane figures formed by the intersection of a double-napped cone and a plane. Conic sections are plane figures formed b the intersection of a double-napped cone and a plane. Chapter 10: Conic Sections Ellipse Hperbola The conic sections ma be defined as the sets of points in the

More information

Incremental Form. Idea. More efficient if we look at d k, the value of the decision variable at x = k

Incremental Form. Idea. More efficient if we look at d k, the value of the decision variable at x = k Idea 1 m 0 candidates last pixel Note that line could have passed through any part of this pixel Decision variable: d = x(a-b) d is an integer d < 0 use upper pixel d > 0 use lower pixel Incremental Form

More information

Computer Graphics. Chapter 4 Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1

Computer Graphics. Chapter 4 Attributes of Graphics Primitives. Somsak Walairacht, Computer Engineering, KMITL 1 Computer Graphics Chapter 4 Attributes of Graphics Primitives Somsak Walairacht, Computer Engineering, KMITL 1 Outline OpenGL State Variables Point Attributes Line Attributes Fill-Area Attributes Scan-Line

More information

Polar Functions Polar coordinates

Polar Functions Polar coordinates 548 Chapter 1 Parametric, Vector, and Polar Functions 1. What ou ll learn about Polar Coordinates Polar Curves Slopes of Polar Curves Areas Enclosed b Polar Curves A Small Polar Galler... and wh Polar

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

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

1 Introduction to Graphics

1 Introduction to Graphics 1 1.1 Raster Displays The screen is represented by a 2D array of locations called pixels. Zooming in on an image made up of pixels The convention in these notes will follow that of OpenGL, placing the

More information

1.2 Visualizing and Graphing Data

1.2 Visualizing and Graphing Data 6360_ch01pp001-075.qd 10/16/08 4:8 PM Page 1 1 CHAPTER 1 Introduction to Functions and Graphs 9. Volume of a Cone The volume V of a cone is given b V = 1 3 pr h, where r is its radius and h is its height.

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

Computer Graphics Lecture Notes

Computer Graphics Lecture Notes Computer Graphics Lecture Notes UNIT- Overview of Computer Graphics. Application of Computer Graphics Computer-Aided Design for engineering and architectural systems etc. Objects maybe displayed in a wireframe

More information

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

Computer Graphics. Lecture 2. Doç. Dr. Mehmet Gokturk Computer Graphics Lecture 2 Doç. Dr. Mehmet Gokturk 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,

More information

Beecher J.A, Penna J.A., Bittinger M.L. Algebra and Trigonometry (3ed, Addison Wesley, 2007) 58 Chapter 1 Graphs, Functions, and Models

Beecher J.A, Penna J.A., Bittinger M.L. Algebra and Trigonometry (3ed, Addison Wesley, 2007) 58 Chapter 1 Graphs, Functions, and Models Beecher J.A, Penna J.A., Bittinger M.L. Algebra and Trigonometr (ed, Addison Wesle, 007) 8 Chapter Graphs, Functions, and Models.. Introduction Polnomial to Functions Graphing and Modeling Plot points.

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

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

Course Number: Course Title: Geometry

Course Number: Course Title: Geometry Course Number: 1206310 Course Title: Geometry RELATED GLOSSARY TERM DEFINITIONS (89) Altitude The perpendicular distance from the top of a geometric figure to its opposite side. Angle Two rays or two line

More information

UNIT -8 IMPLEMENTATION

UNIT -8 IMPLEMENTATION UNIT -8 IMPLEMENTATION 1. Discuss the Bresenham s rasterization algorithm. How is it advantageous when compared to other existing methods? Describe. (Jun2012) 10M Ans: Consider drawing a line on a raster

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

Answers. Investigation 4. ACE Assignment Choices. Applications

Answers. Investigation 4. ACE Assignment Choices. Applications Answers Investigation ACE Assignment Choices Problem. Core Other Connections, ; Etensions ; unassigned choices from previous problems Problem. Core, 7 Other Applications, ; Connections ; Etensions ; unassigned

More information

Developed in Consultation with Tennessee Educators

Developed in Consultation with Tennessee Educators Developed in Consultation with Tennessee Educators Table of Contents Letter to the Student........................................ Test-Taking Checklist........................................ Tennessee

More information

Time: 3 hours Max. Marks: 80. Note: Answer FIVE full questions, choosing one full question from each module.

Time: 3 hours Max. Marks: 80. Note: Answer FIVE full questions, choosing one full question from each module. USN 6 th Semester CBCS Scheme Model Question Paper 1 Department of Computer Science and Engineering, C. Byregowda Institute of Technology Computer Graphics and Visualization Time: 3 hours Max. Marks: 80

More information

This library uses only GL functions but contains code for creating common objects and simplifying viewing.

This library uses only GL functions but contains code for creating common objects and simplifying viewing. PES Institute of Technology, Bangalore South Campus (Formerly PES School of Engineering) (Hosur Road, 1KM before Electronic City, Bangalore-560 100) INTERNAL TEST (SCHEME AND SOLUTION) 1 Subject Name:

More information

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU FROM VERTICES TO FRAGMENTS Lecture 5 Comp3080 Computer Graphics HKBU OBJECTIVES Introduce basic implementation strategies Clipping Scan conversion OCTOBER 9, 2011 2 OVERVIEW At end of the geometric pipeline,

More information

Alternate Angles. Clip 67. Mathswatch

Alternate Angles. Clip 67. Mathswatch Clip 67 Alternate Angles ) Line PQ is parallel to line RS If angle PQR is equal to 6 a) What is the size of angle QRS? b) Give a reason for ou answer. P 6 Q R S ) Line DCE is parallel to line AB a) Find

More information

Overview of Computer Graphics

Overview of Computer Graphics Application of Computer Graphics UNIT- 1 Overview of Computer Graphics Computer-Aided Design for engineering and architectural systems etc. Objects maybe displayed in a wireframe outline form. Multi-window

More information

Parabolas Section 11.1

Parabolas Section 11.1 Conic Sections Parabolas Section 11.1 Verte=(, ) Verte=(, ) Verte=(, ) 1 3 If the equation is =, then the graph opens in the direction. If the equation is =, then the graph opens in the direction. Parabola---

More information

What and Why Transformations?

What and Why Transformations? 2D transformations What and Wh Transformations? What? : The geometrical changes of an object from a current state to modified state. Changing an object s position (translation), orientation (rotation)

More information

12.1. Angle Relationships. Identifying Complementary, Supplementary Angles. Goal: Classify special pairs of angles. Vocabulary. Complementary. angles.

12.1. Angle Relationships. Identifying Complementary, Supplementary Angles. Goal: Classify special pairs of angles. Vocabulary. Complementary. angles. . Angle Relationships Goal: Classif special pairs of angles. Vocabular Complementar angles: Supplementar angles: Vertical angles: Eample Identifing Complementar, Supplementar Angles In quadrilateral PQRS,

More information

Grade 9 Math Terminology

Grade 9 Math Terminology Unit 1 Basic Skills Review BEDMAS a way of remembering order of operations: Brackets, Exponents, Division, Multiplication, Addition, Subtraction Collect like terms gather all like terms and simplify as

More information

Polygonal Meshes: Representing 3D Objects

Polygonal Meshes: Representing 3D Objects Polygonal Meshes: Representing 3D Objects Real world modeling requires representation of surfaces Two situations: 1. Model an existing object Most likely can only approximate the object Represent all (most)

More information

RASTERIZING POLYGONS IN IMAGE SPACE

RASTERIZING POLYGONS IN IMAGE SPACE On-Line Computer Graphics Notes RASTERIZING POLYGONS IN IMAGE SPACE Kenneth I. Joy Visualization and Graphics Research Group Department of Computer Science University of California, Davis A fundamental

More information

Section 9.3: Functions and their Graphs

Section 9.3: Functions and their Graphs Section 9.: Functions and their Graphs Graphs provide a wa of displaing, interpreting, and analzing data in a visual format. In man problems, we will consider two variables. Therefore, we will need to

More information

x=2 26. y 3x Use calculus to find the area of the triangle with the given vertices. y sin x cos 2x dx 31. y sx 2 x dx

x=2 26. y 3x Use calculus to find the area of the triangle with the given vertices. y sin x cos 2x dx 31. y sx 2 x dx 4 CHAPTER 6 APPLICATIONS OF INTEGRATION 6. EXERCISES 4 Find the area of the shaded region.. =5-. (4, 4) =. 4. = - = (_, ) = -4 =œ + = + =.,. sin,. cos, sin,, 4. cos, cos, 5., 6., 7.,, 4, 8., 8, 4 4, =_

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

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into 2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into the viewport of the current application window. A pixel

More information

Prerequisite Skills Appendix

Prerequisite Skills Appendix Prerequisite Skills Appendi Adding Polnomials To add, add the like terms. 9 1. Add. a) b) 7 6 7 c) 6 d) a a 8 a a 1 e) f) 6a b a b 7 Angle Properties To find the measure of, recall that the sum of the

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

Math 20C. Lecture Examples.

Math 20C. Lecture Examples. Math 20C. Lecture Eamples. (8/7/0) Section 4.4. Linear approimations and tangent planes A function z = f(,) of two variables is linear if its graph in z-space is a plane. Equations of planes were found

More information

A New Line Drawing Algorithm Based on Sample Rate Conversion

A New Line Drawing Algorithm Based on Sample Rate Conversion A New Line Drawing Algorithm Based on Sample Rate Conversion c 2002, C. Bond. All rights reserved. February 5, 2002 1 Overview In this paper, a new method for drawing straight lines suitable for use on

More information

ACT Math and Science - Problem Drill 11: Plane Geometry

ACT Math and Science - Problem Drill 11: Plane Geometry ACT Math and Science - Problem Drill 11: Plane Geometry No. 1 of 10 1. Which geometric object has no dimensions, no length, width or thickness? (A) Angle (B) Line (C) Plane (D) Point (E) Polygon An angle

More information

CS452/552; EE465/505. Clipping & Scan Conversion

CS452/552; EE465/505. Clipping & Scan Conversion CS452/552; EE465/505 Clipping & Scan Conversion 3-31 15 Outline! From Geometry to Pixels: Overview Clipping (continued) Scan conversion Read: Angel, Chapter 8, 8.1-8.9 Project#1 due: this week Lab4 due:

More information

SECTION 8.2 the hyperbola Wake created from shock wave. Portion of a hyperbola

SECTION 8.2 the hyperbola Wake created from shock wave. Portion of a hyperbola SECTION 8. the hperola 6 9 7 learning OjeCTIveS In this section, ou will: Locate a hperola s vertices and foci. Write equations of hperolas in standard form. Graph hperolas centered at the origin. Graph

More information

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

Birkdale High School - Higher Scheme of Work

Birkdale High School - Higher Scheme of Work Birkdale High School - Higher Scheme of Work Module 1 - Integers and Decimals Understand and order integers (assumed) Use brackets and hierarchy of operations (BODMAS) Add, subtract, multiply and divide

More information

Appendix C: Review of Graphs, Equations, and Inequalities

Appendix C: Review of Graphs, Equations, and Inequalities Appendi C: Review of Graphs, Equations, and Inequalities C. What ou should learn Just as ou can represent real numbers b points on a real number line, ou can represent ordered pairs of real numbers b points

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