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

Size: px
Start display at page:

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

Transcription

1 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, lines, polygons (coloured and shaded) Projection is followed by Scan-conversion. D Parametric Attributes Display List D polygons OpenGL Graphics System Evaluator D polygons Pixel Operations Per- Vertex D points Texture Memory D pixels colours Rasterization Per- Fragment D pixels colours blending clipping Frame Buffer D Graphics Primitives D Primitives: lines, circles... Co-ordinate Conventions Drawing D Primitives Scan Conversion: filled area primitives Attributes of D Graphics Primitives Antialiasing Drawing D Graphics Primitives D Primitives: Lines Circles Ellipses Other Curves Polygons: empty and filled - Characters General Mathematical D Primitives Parametric Equations (x(t), y(t)) Line x(t)=x +t(x x ) y(t)=y +t(y y ) Implicit Equations < inside F(x, y)= > outside f (x,y)=ax + by + c a=y y b=x x c=x y x y Scan Conversion Scan Conversion also known as Rasterization Can be thought of in two equivalent ways: - As a Convolution between an ideal mathematical function (infinitely thin line) and an object the size and shape of a pixel followed by sampling at the pixel positions - Pixels have finite area, output is overlap of pixel with curve

2 Co-ordinate Conventions What convention is used for coordinate system?. Like square Graph paper: pixels are unit squares that tile the plane with corners at [(x,y),(x +,y + )]. Pixels centred on integer co-ordinates: mathematical. Co-ordinate Conventions Graph Paper I will use this convention, point is at [,] Point at x =, y = Pixel Centred Drawing Lines Basic line drawing Digital Differential Analyser (DDA) Accelerating Basic Line Drawing Uses the simplest expression for a straight line Considers entire line Technique requires floating point and function call in inner-most loop of algorithm which is slow Care needed with end points to get length correct Basic Line Drawing Basic Line Drawing x = # $ " % x = # $ " % ( [ ]) ( [ ]) y i = mx i + c x i, Round y i where m = "y "x and x i, Floor y i +. y i = "y "x x i + c c = y i # "y "x x i

3 Basic Line Drawing Example x = # $ " % x = # $ " % m = "y "x = c = y "y "x x = Basic Line Drawing Example i x i y i y i +." Basic Line Drawing x = # $ " % x = # $ " % Basic Line Drawing Issues NB If we plot the final end point of the line the length would be x = and y = instead of the required x = and y = " Plot pixels interior to the line path Each iteration requires a floating point multiply, add, and the use of the Floor function. Line Drawing: DDA Digital Differential Analyser Solves a parametric equation by solving a differential equation In general the parametric form can be converted to a differential equation using its Taylor expansion: d f = f (t + dt) f (t + dt)= f (t) + f (t)dt + f (t) dt + K DDA for straight lines Polynomial of order n has at most n non-zero derivatives. For straight lines, y(x) = mx + c, this is effectively: dy = y( x + dx) y( x) = y "( x)dx rearranging : y(x + dx) = y(x) + y "(x).dx Remember that: m = y x

4 DDA for Straight lines DDA Line Drawing If we let dx=, and recognise y (x) as, m, the line gradient: y k+ = mx k + + c = m(x k +) + c = y k + m x = # $ " % x = # $ " % DDA DDA algorithm for arbitrary slopes Result is identical to Basic method Core of calculation requires only an addition + Floor operation Uses only gradient, no explicit use of intercept So far slope has been: m - m : step in x and use: y k+ = y k + m m > : reverse roles of x and y (step in y) and use: x k+ = x k + m FAST Recursive For each point on the line uses: - integer add - or integer increments - integer comparison Uses decision variable Deal with slopes m to start with yk + yk B d A d xk xk + Just drawn shaded Pixel Which pixel do we draw next, A or B?

5 y co-ordinate of ideal mathematical line at position (xk+) is: - y = m(xk + ) + c Distance to pixel centre below line is: - d = y - yk = m(xk + ) + c - yk Distance to discrete point above line is: - d = (yk + ) - y = (yk + ) - m(xk + ) - c Difference (d - d) of distances: - d - d = m(xk + ) - yk + c - By substituting, m = "y/"x, and rearranging, we can get and integer only expression DEFINE Decision variable to be: - pk = "x (d - d) Substituting for (d - d) : - pk = "y xk - "x yk + K where K is a constant. Decision variable: - pk = "y xk - "x yk + K pk has the same sign as (d - d), since "x is +ve. pk < # choose yk+ = yk pk $ # choose yk+ = yk + Decision variable at next point: - pk+ = "y xk+ - "x yk+ + K Take difference of decision variable at current and next point (eliminates K): - pk+ - pk = "y (xk+ - xk) - "x (yk+ - yk) Giving recurrence relation for pk+: - pk+ = pk + "y - "x (yk+ - yk), - since (xk+ - xk) = Recurrence relation for decision pk+ = pk + "y - "x (yk+ - yk) Which can take on two forms, either: - If (pk < ) # choose yk+ = yk - pk+ = pk + "y (since (yk+ - yk)=) Or - - If pk $ # choose yk+ = yk + pk+ = pk + "y - "x (since (yk+ - yk)=) Initialising Decision Variable: Recall from earlier pk = "y xk - "x yk + K where K = "y + "x(c - ) Since: - c = y - x "y/"x# c "x = "x y - x "y We can substitute for c "x above with k= p = "y - "x

6 Setup. Input endpoints,. Store left endpoint in (x, y). Draw pixel at (x, y). Calculate constants: "x, "y, ( "y), ( "y- "x). Initialise decision variable: p = "y - "x Loop For each xk, from k = to k = "x- - If ( pk < ) Draw pixel at (xk +, yk) - pk+ = pk + ( "y) - Else Draw pixel at (xk +, yk+) - pk+ = pk + ( "y - "x) Bresenham Line Example Bresenham Line Example x = # $ " % x = # $ " % x = # $ " % x = # $ " % Bresenham Line Example x = # $ " % x = # $ " % Generalising Line to Arbitrary Orientations So far have considered lines with slope between and + (first octant) Need to consider implications for algorithm of arbitrary slopes of lines

7 Slope > Interchange roles of x and y axes Calculate x values of line points Step along y direction in unit increments Could also revise algorithm to plot points in either direction - Both x and y decrease as line is generated - Decide on convention for d = d (plot lower or upper, but must be consistent) Procedure is similar Slope < One co-ordinate decreases as the other increases For negative slope < - again axes are swapped - Decrement y axis co-ordinate - Calculate new x co-ordinate Special Cases Horizontal lines and Vertical lines can be detected at the initialisation stage (before the Bresenham inner loop) and written directly into the Frame Buffer Drawing Circles Basic Circle drawing Accelerating Circle s by exploiting symmetry Midpoint () Circle Details Circle Drawing Techniques Circle is defined by: - (x - xc) + (y - yc) = r Solving this gives: - y = yc ± %(r - (x - xc)) Computation of square root Step in x Also need to swap axes to step in y rather than x Step in y Circle Drawing Techniques Calculate points along a circular boundary by stepping in equal increments of angle: Polar parametric form: - x = xc + r cos - y = yc + r sin Again considerable computation of trigonometric expressions

8 Reducing computation by Symmetry of circles Can work in quadrants Even more efficient to exploit octants Need only compute one eighth of circle points: Work in single octant Variation of algorithm more easily extended to ellipses and other curves Need to set up a decision variable to determine which pixel is next plotted around circular path Use implicit circle function: f (x,y) = x + y r f (x,y) = x + y r Implicit function for a circle: f(x, y) <, inside circle f(x, y) =, on the circle - f(x, y) >, outside circle These tests are performed on the midpoint between two candidate next points y k y k - x k x k +?? Work in third quadrant Need to keep points plotted by algorithm internal to circle in graph paper coordinate convention Work in sixth Octant and exploit symmetry yk + yk A B?? Work in single octant xk - xk

9 : Decision parameter In previous slide have just drawn pixel at (xk, yk), which is next pixel B is at (xk -, yk), or pixel A is at (xk -, yk + )? Decision variable is circle function evaluated at the midpoint: p k = f (x k +.,y k + ) = f (x k.,y k + ) p k = (x k.) + (y k + ) r Decision Parameter If p k < - Midpoint is INSIDE circle - Plot point B Else - Midpoint is OUTSIDE circle - Plot point A Decision Parameter We have an expression for already, then p k+ = (x k+.) + (y k+ + ) r And because x k+ = x k p k+ = (x k.) + (y k+ + ) r p k Decision Parameter Get a recurrence relation for the decision parameter by forming: p k+ p k We then rearrange this to get an expression for: p k+ =p k (x k + ) + (y k+ + y k )(y k+ y k ) + (y k+ y k ) NB (y k+ y k ) will either be + or Initialising Decision Parameter p = f (, r) =(.) + ( r + ) r =. r For integer radius we can take the floor of this to be: p = r To write down the algorithm we have noted that when: y k+ = y k + p k+ =p k (x k + ) + (y k+ + y k )(y k+ y k ) + (y k+ y k ) Simplifies to: p k+ = p k + (y k x k ) + Since: y k+ = y k + and y k+ y k =

10 IF pk < midpoint INSIDE xk+ = xk - yk+ = yk SetCirclePoints(xk+, yk +) pk+ = pk - xk + ELSE midpoint OUTSIDE xk+ = xk - yk+ = yk + SetCirclePoints(xk+, yk+) pk+ = pk + (yk - xk) Circle R= Circle R = Circle R= Conics Circles are a member of a group of functions, the conics, their general form is: Ax + By +Cxy + Dx + Ey + F = Particular conic is given by: - B - AC < Ellipse or Circle - B - AC = Parabola - B - AC > Hyperbola Hearn and Baker, p -

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

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

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

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

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

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

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

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

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

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 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

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

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

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

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

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

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

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

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

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

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 Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14

Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14 Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 14 Scan Converting Lines, Circles and Ellipses Hello everybody, welcome again

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

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 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: 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

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

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

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

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

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

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

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

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

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

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

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

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

Lab Manual. Computer Graphics. T.E. Computer. (Sem VI)

Lab Manual. Computer Graphics. T.E. Computer. (Sem VI) Lab Manual Computer Graphics T.E. Computer (Sem VI) Index Sr. No. Title of Programming Assignments Page No. 1. Line Drawing Algorithms 3 2. Circle Drawing Algorithms 6 3. Ellipse Drawing Algorithms 8 4.

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

Scan Converting Circles

Scan Converting Circles Scan Conversion Algorithms CS 460 Computer Graphics Professor Richard Eckert Circles Ellipses and Other 2-D Curves Text February 16, 2004 Scan Converting Circles Given: Center: (h,k) Radius: r Equation:

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

Polar (BC Only) They are necessary to find the derivative of a polar curve in x- and y-coordinates. The derivative

Polar (BC Only) They are necessary to find the derivative of a polar curve in x- and y-coordinates. The derivative Polar (BC Only) Polar coordinates are another way of expressing points in a plane. Instead of being centered at an origin and moving horizontally or vertically, polar coordinates are centered at the pole

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

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

(Refer Slide Time: 00:03:51)

(Refer Slide Time: 00:03:51) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 17 Scan Converting Lines, Circles and Ellipses Hello and welcome everybody

More information

To sketch the graph we need to evaluate the parameter t within the given interval to create our x and y values.

To sketch the graph we need to evaluate the parameter t within the given interval to create our x and y values. Module 10 lesson 6 Parametric Equations. When modeling the path of an object, it is useful to use equations called Parametric equations. Instead of using one equation with two variables, we will use two

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

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

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

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Computer Graphics

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Computer Graphics r About the Tutorial To display a picture of any size on a computer screen is a difficult process. Computer graphics are used to simplify this process. Various algorithms and techniques are used to generate

More information

1.1 Functions. Cartesian Coordinate System

1.1 Functions. Cartesian Coordinate System 1.1 Functions This section deals with the topic of functions, one of the most important topics in all of mathematics. Let s discuss the idea of the Cartesian coordinate system first. Cartesian Coordinate

More information

EFFICIENT INTEGER ALGORITHMS FOR THE GENERATION OF CONIC SECTIONS

EFFICIENT INTEGER ALGORITHMS FOR THE GENERATION OF CONIC SECTIONS Comput. & Graphics, Vol. 22, No. 5, pp. 621±628, 1998 # 1998 Elsevier Science Ltd. All rights reserved PII: S0097-8493(98)00069-7 Printed in Great Britain 0097-8493/98/$ - see front matter EFFICIENT INTEGER

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

13.1 2/20/2018. Conic Sections. Conic Sections: Parabolas and Circles

13.1 2/20/2018. Conic Sections. Conic Sections: Parabolas and Circles 13 Conic Sections 13.1 Conic Sections: Parabolas and Circles 13.2 Conic Sections: Ellipses 13.3 Conic Sections: Hyperbolas 13.4 Nonlinear Systems of Equations 13.1 Conic Sections: Parabolas and Circles

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

Rasterization and Graphics Hardware. Not just about fancy 3D! Rendering/Rasterization. The simplest case: Points. When do we care?

Rasterization and Graphics Hardware. Not just about fancy 3D! Rendering/Rasterization. The simplest case: Points. When do we care? Where does a picture come from? Rasterization and Graphics Hardware CS559 Course Notes Not for Projection November 2007, Mike Gleicher Result: image (raster) Input 2D/3D model of the world Rendering term

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

Points and lines. x x 1 + y 1. y = mx + b

Points and lines. x x 1 + y 1. y = mx + b Points and lines Point is the fundamental element of the picture representation. It is nothing but the position in a plan defined as either pairs or triplets of number depending on whether the data are

More information

Computer Graphics 7 - Rasterisation

Computer Graphics 7 - Rasterisation Computer Graphics 7 - Rasterisation Tom Thorne Slides courtesy of Taku Komura www.inf.ed.ac.uk/teaching/courses/cg Overview Line rasterisation Polygon rasterisation Mean value coordinates Decomposing polygons

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

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

Lecture 5. If, as shown in figure, we form a right triangle With P1 and P2 as vertices, then length of the horizontal

Lecture 5. If, as shown in figure, we form a right triangle With P1 and P2 as vertices, then length of the horizontal Distance; Circles; Equations of the form Lecture 5 y = ax + bx + c In this lecture we shall derive a formula for the distance between two points in a coordinate plane, and we shall use that formula to

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

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

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

Chapter 1. Linear Equations and Straight Lines. 2 of 71. Copyright 2014, 2010, 2007 Pearson Education, Inc.

Chapter 1. Linear Equations and Straight Lines. 2 of 71. Copyright 2014, 2010, 2007 Pearson Education, Inc. Chapter 1 Linear Equations and Straight Lines 2 of 71 Outline 1.1 Coordinate Systems and Graphs 1.4 The Slope of a Straight Line 1.3 The Intersection Point of a Pair of Lines 1.2 Linear Inequalities 1.5

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

form. We will see that the parametric form is the most common representation of the curve which is used in most of these cases.

form. We will see that the parametric form is the most common representation of the curve which is used in most of these cases. Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 36 Curve Representation Welcome everybody to the lectures on computer graphics.

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

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

MET71 COMPUTER AIDED DESIGN

MET71 COMPUTER AIDED DESIGN UNIT - II BRESENHAM S ALGORITHM BRESENHAM S LINE ALGORITHM Bresenham s algorithm enables the selection of optimum raster locations to represent a straight line. In this algorithm either pixels along X

More information

9.1 Linear Inequalities in Two Variables Date: 2. Decide whether to use a solid line or dotted line:

9.1 Linear Inequalities in Two Variables Date: 2. Decide whether to use a solid line or dotted line: 9.1 Linear Inequalities in Two Variables Date: Key Ideas: Example Solve the inequality by graphing 3y 2x 6. steps 1. Rearrange the inequality so it s in mx ± b form. Don t forget to flip the inequality

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

Conic Sections. College Algebra

Conic Sections. College Algebra Conic Sections College Algebra Conic Sections A conic section, or conic, is a shape resulting from intersecting a right circular cone with a plane. The angle at which the plane intersects the cone determines

More information

, minor axis of length 12. , asymptotes y 2x. 16y

, minor axis of length 12. , asymptotes y 2x. 16y Math 4 Midterm 1 Review CONICS [1] Find the equations of the following conics. If the equation corresponds to a circle find its center & radius. If the equation corresponds to a parabola find its focus

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

MEI Desmos Tasks for AS Pure

MEI Desmos Tasks for AS Pure Task 1: Coordinate Geometry Intersection of a line and a curve 1. Add a quadratic curve, e.g. y = x² 4x + 1 2. Add a line, e.g. y = x 3 3. Select the points of intersection of the line and the curve. What

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

Sketching graphs of polynomials

Sketching graphs of polynomials Sketching graphs of polynomials We want to draw the graphs of polynomial functions y = f(x). The degree of a polynomial in one variable x is the highest power of x that remains after terms have been collected.

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

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

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

UNIT 3 EXPRESSIONS AND EQUATIONS Lesson 3: Creating Quadratic Equations in Two or More Variables

UNIT 3 EXPRESSIONS AND EQUATIONS Lesson 3: Creating Quadratic Equations in Two or More Variables Guided Practice Example 1 Find the y-intercept and vertex of the function f(x) = 2x 2 + x + 3. Determine whether the vertex is a minimum or maximum point on the graph. 1. Determine the y-intercept. The

More information

Module 3: Stand Up Conics

Module 3: Stand Up Conics MATH55 Module 3: Stand Up Conics Main Math concepts: Conic Sections (i.e. Parabolas, Ellipses, Hyperbolas), nd degree equations Auxilliary ideas: Analytic vs. Co-ordinate-free Geometry, Parameters, Calculus.

More information

Pre-Calculus Guided Notes: Chapter 10 Conics. A circle is

Pre-Calculus Guided Notes: Chapter 10 Conics. A circle is Name: Pre-Calculus Guided Notes: Chapter 10 Conics Section Circles A circle is _ Example 1 Write an equation for the circle with center (3, ) and radius 5. To do this, we ll need the x1 y y1 distance formula:

More information

Rendering approaches. 1.image-oriented. 2.object-oriented. foreach pixel... 3D rendering pipeline. foreach object...

Rendering approaches. 1.image-oriented. 2.object-oriented. foreach pixel... 3D rendering pipeline. foreach object... Rendering approaches 1.image-oriented foreach pixel... 2.object-oriented foreach object... geometry 3D rendering pipeline image 3D graphics pipeline Vertices Vertex processor Clipper and primitive assembler

More information

Unit 3 Higher topic list

Unit 3 Higher topic list This is a comprehensive list of the topics to be studied for the Edexcel unit 3 modular exam. Beside the topics listed are the relevant tasks on www.mymaths.co.uk that students can use to practice. Logon

More information

Unit 12 Topics in Analytic Geometry - Classwork

Unit 12 Topics in Analytic Geometry - Classwork Unit 1 Topics in Analytic Geometry - Classwork Back in Unit 7, we delved into the algebra and geometry of lines. We showed that lines can be written in several forms: a) the general form: Ax + By + C =

More information

Graphics System. Processor. Output Display. Input Devices. Frame Buffer. Memory. Array of pixels. Resolution: # of pixels Depth: # of bits/pixel

Graphics System. Processor. Output Display. Input Devices. Frame Buffer. Memory. Array of pixels. Resolution: # of pixels Depth: # of bits/pixel Graphics System Input Devices Processor Memory Frame Buffer Output Display Array of pixels Resolution: # of pixels Depth: # of bits/pixel Input Devices Physical Devices: Keyboard, Mouse, Tablet, etc. Logical

More information

Algebra II Chapter 10 Conics Notes Packet. Student Name Teacher Name

Algebra II Chapter 10 Conics Notes Packet. Student Name Teacher Name Algebra II Chapter 10 Conics Notes Packet Student Name Teacher Name 1 Conic Sections 2 Identifying Conics Ave both variables squared?' No PARABOLA y = a(x- h)z + k x = a(y- k)z + h YEs Put l'h squared!'erms

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

Surface shading: lights and rasterization. Computer Graphics CSE 167 Lecture 6

Surface shading: lights and rasterization. Computer Graphics CSE 167 Lecture 6 Surface shading: lights and rasterization Computer Graphics CSE 167 Lecture 6 CSE 167: Computer Graphics Surface shading Materials Lights Rasterization 2 Scene data Rendering pipeline Modeling and viewing

More information

I Internal Examination (Model Paper) B.Tech III Year VI semester, Computer Science & Engineering

I Internal Examination (Model Paper) B.Tech III Year VI semester, Computer Science & Engineering I Internal Examination 2017-18 (Model Paper) B.Tech III Year VI semester, Computer Science & Engineering Subject: 6CS4 Computer Graphics & Multimedia Technology Time: 1:30 Hr M.M:40 Question No. Question

More information

Math 231E, Lecture 34. Polar Coordinates and Polar Parametric Equations

Math 231E, Lecture 34. Polar Coordinates and Polar Parametric Equations Math 231E, Lecture 34. Polar Coordinates and Polar Parametric Equations 1 Definition of polar coordinates Let us first recall the definition of Cartesian coordinates: to each point in the plane we can

More information

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

COMPUTER AIDED ENGINEERING DESIGN (BFF2612) COMPUTER AIDED ENGINEERING DESIGN (BFF2612) BASIC MATHEMATICAL CONCEPTS IN CAED by Dr. Mohd Nizar Mhd Razali Faculty of Manufacturing Engineering mnizar@ump.edu.my COORDINATE SYSTEM y+ y+ z+ z+ x+ RIGHT

More information

Rasterization. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 16

Rasterization. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 16 Rasterization CS 4620 Lecture 16 1 Announcements A3 due on Thu Will send mail about grading once finalized 2 Pipeline overview you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX

More information

CS602 MCQ,s for midterm paper with reference solved by Shahid

CS602 MCQ,s for midterm paper with reference solved by Shahid #1 Rotating a point requires The coordinates for the point The rotation angles Both of above Page No 175 None of above #2 In Trimetric the direction of projection makes unequal angle with the three principal

More information

Unit 2: Function Transformation Chapter 1. Basic Transformations Reflections Inverses

Unit 2: Function Transformation Chapter 1. Basic Transformations Reflections Inverses Unit 2: Function Transformation Chapter 1 Basic Transformations Reflections Inverses Section 1.1: Horizontal and Vertical Transformations A transformation of a function alters the equation and any combination

More information