CSC Computer Graphics
|
|
- Gwen Bennett
- 6 years ago
- Views:
Transcription
1 7//7 CSC. Computer Graphics Lecture Department of Computer Science Universit of Sri Jaewardanepura Line drawing algorithms DDA Midpoint (Bresenham s) Algorithm Circle drawing algorithms Simple Circle Algorithm Mid-Point Circle Algorithm Ellipse drawing algorithms Simple Ellipse Algorithm Midpoint Ellipse Algorithm 7//7 - Facult of Applied Sciences of USJP A line segment in a scene is defined b the coordinate positions of the line end-points (7, ) (, ) 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP But what happens when we tr to draw this on a piel based displa? Considerations to eep in mind: The line has to loo good Avoid jaggies It has to be lightening fast! Millions of lines need to be drawn in a tpical scene. How do we choose which piels to turn on? 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6
2 7//7 Lines must create visuall satisfactor images. Lines should appear straight Lines should terminate accuratel Lines should have constant densit Line densit should be independent of line length and angle. Ideall, the following properties should be considered Smooth Continuous Pass through specified points Uniform brightness Efficient 7//7 - Facult of Applied Sciences of USJP 7 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 8 There are three possible choices. Eplicit: = f() = m ( - ) + where m = d/d Parametric: = f(t), = f(t) = + t( - ), t in [,] = + t( - ) Implicit: f(, ) = F(,) = (-)d - (-)d if F(,) = then (,) is on line F(,) > then (,) is below line F(,) < then (,) is above line 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 9 DrawLine(int, int, int, int, int color) float ; int ; for (=; <=; ++) = + (-)*(-)/(-) WritePiel(, Round(), color ); 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP DrawLine(int,int,int,int, int color) float m,; int d,d,; d = - ; d = - ; m = d/d; = +.; for (=; <=; ++) WritePiel(, Floor(), color ); = + m; A Better Implementation 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP Advantages over Algorithm Eliminates multiplication thus improves speed Disadvantages Round-off error builds up Get piel drift Rounding and floating point arithmetic still time consuming Wors well onl for m < Need to loop in for m > Need to handle special cases 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP
3 7//7 Let s quicl review the equations involved in drawing lines end end Slope-intercept line equation: m c where: m end end c m 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 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 = - / m = - / m = m = - m = - m = - m = m = m = m = m = / m = / m = 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP We could simpl wor out the corresponding coordinate for each unit coordinate Let s consider the following eample: (7, ) (, ) 7 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6 7 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6 (, ) 6 7 (7, ) First wor out m and b: m 7 c Now for each value wor out the value: ( ) ( ) ( ) ( 6) 6 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7 Now just round off the results and turn on these piels to draw our line ( ) ( ) ( ) ( 6) 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 8
4 7//7 However, this approach is just wa too slow In particular loo out for: The equation = m + c requires the multiplication of m b Rounding off the resulting coordinates We need a faster solution In the previous eample we chose to solve the parametric line equation to give us the coordinate for each unit coordinate What if we had done it the other wa around? Where: c m and m end end c m 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 9 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP Leaving out the details this gives us: ( ) ( ) We can see easil that 7 this line doesn t loo 6 ver good! We choose which wa to wor out the line piels based on the slope of the line //7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP If the slope of a line is between - and then we wor out the coordinates for a line based on it s unit coordinates Otherwise we do the opposite coordinates are computed based on unit coordinates m = - / m = - / m = m = - m = - m = - m = m = m = m = m = / m = / m = 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP Given points P = (, ) and P = (, ) = + t( - ) = + t( - ) t is called the parameter. When t = we get (, ) t = we get (, ) As < t < we get all the other points on the line segment between (, ) and (, ). 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP
5 7//7 The digital differential analzer (DDA) algorithm taes an incremental approach in order to speed up scan conversion Simpl calculate + based on The original differential analzer w a s a p h s i c a l m a c h i n e developed b Vannevar Bush at MIT in the 9 s in order to solve ordina r differen tia l e q u a t i o n s. M o r e i n f o r m a t i o n h e r e. 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6 Digital differential analser Y=m+c For m< =m For m> = /m 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7 Procedure DDA(X,Y,X,Y :Integer); Var Length, I :Integer; X,Y,Xinc,Yinc :Real; Begin Length := ABS(X - X); If ABS(Y -Y) > Length Then Length := ABS(Y-Y); Xinc := (X - X)/Length; Yinc := (Y -Y)/Length; X := X; Y := Y; For I := To Length Do Begin Plot(Round(X), Round(Y)); X := X + Xinc; Y := Y + Yinc End For End; DDA 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 8 Compute which piels should be turned on to represent the line from (6,9) to (,). Length := Ma of (ABS(-6), ABS(-9)) = Xinc := Yinc :=.6 Values computed are: (6,9), (7,9.6), (8,.), (9,.8), (,.), (,) //7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 9 Consider the list of points that we determined for the line in our previous eample: (, ), (, / ), (, / ), (, / ), (6, / ), (7, ) Notice that as the coordinates go up b one, the coordinates simpl go up b the slope of the line This is the e insight in the DDA algorithm 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP
6 7//7 When the slope of the line is between - and begin at the first point in the line and, b incrementing the coordinate b, calculate the corresponding coordinates as follows: m When the slope is outside these limits, increment the coordinate b and calculate the corresponding coordinates as follows: m 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP Again the values calculated b the equations used b the DDA algorithm must be rounded to match piel values ( +, round( +m)) (, ) ( +, +m) (, round( )) (round( + / m ), +) (, ) ( + / m, +) (round( ), ) 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP Let s tr out the following eamples: (, 7) 7 (7, ) (, ) (, ) 7 It is much faster than our previous attempt. No an multiplications involved. However, there are still two big issues: Accumulation of round-off errors can mae the pielated line drift awa from what was intended The rounding operations and floating point arithmetic involved are time consuming 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP It is another incremental scan conversion algorithm. The big advantage of this algorithm is that it uses onl integer calculations J a c B r e s e n h a m wored for 7 ears at IBM before entering academia. Bresenham developed his famous algorithms at IBM in t h e e a r l 96s 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6 6
7 7//7 The midpoint algorithm is even better than the above algorithm in that it uses onl integer calculations. It treats line drawing as a sequence of decisions. For each piel that is drawn the net piel will be either N or NE, as shown below. It uses the implicit definition of the line, F(,) =. The N/NE decisions are made as follows. d = F( p +, p +.) if d < line below midpoint choose E if d > line above midpoint choose NE if E is chosen d new = F( p +, p +.) d new - d old = F( p +, p +.) - F( p +, p +.) Delta = d new -d old = d 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 8 If NE is chosen d new = F( p +, p +.) Delta = d-d Initialization d start = F( +, +.) = ( +- )d - ( +.- )d = d-d/ Integer onl algorithm F (,) = F(,) ; d = d d start = d - d Delta = Delta DrawLine(int, int, int, int, int color) int d, d, d, ince, incne,, ; d = - ; d = - ; d = *d - d; ince = *d; incne = *(d - d); = ; for (=; <=; ++) WritePiel(,, color); if (d>) d = d + incne; = + ; else d = d + ince; 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 9 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP The initial value for the decision variable, d, ma be calculated directl from the formula at point (,). d = f( +, + /) = b() - a(/) = b - a/ Therefore, the algorithm for a line from (,) to (a,b) in the first octant is: Note: The onl non-integer value is a/. If we then multipl b to get d' = d, we can do all integer arithmetic using onl the operations +, -, and left-shift. The algorithm still wors since we onl care about the sign, not the value of d. := ; := ; d := b - a/; For i := to a do Plot(,); If d >= Then := + ; := + ; d := d + b a Else := + ; d := d + b End End 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP To generalize lines with arbitrar slopes Consider smmetr between various octants and quadrants For m >, interchange roles of and, that is step in direction, and decide whether the value is above or below the line. If m >, and right endpoint is the first point, both and decrease. To ensure uniqueness, independent of direction, alwas choose upper (or lower) point if the line go through the mid-point. Handle special cases without invoing the algorithm: horizontal, vertical and diagonal lines 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7
8 7//7 Generalize the algorithm to wor for lines beginning at points other than (,) b giving and the proper initial values. Note: This algorithm onl wors for lines with slopes between and Begin Bresenham for lines with slope between and a := ABS(end - start); b := ABS(end - start); d := *b - a; Incr := *(b-a); Incr := *b; If start > end Then := end; := end Else := start; := start End For I := to a Do Plot(,); := + ; If d >= Then := + ; d := d + incr Else d := d + incr End End For Loop End Bresenham Move across the ais in unit intervals and at each step choose between two different coordinates (, ) ( +, +) ( +, ) For eample, from position (, ) we have to choose between (, ) and (, ) We would lie the point that is closer to the original line 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP At sample position + the vertical separations from the mathematical line are labelled d upper and d lower + The coordinate on the mathematical line at + is: m( ) b d upper + d lower So, d upper and d lower are given as follows: and: d d lower upper m( ) b ( ) m( ) b We can use these to mae a simple decision about which piel is closer to the mathematical line 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6 Eplicit: = f() R Usuall, we draw a quarter circle b incrementing from to R in unit steps and solving for + for each step. Parametric: Rcos Rsin - b stepping the angle from to 9 - avoids large gaps but still insufficient. Implicit: f() = + -R If f(,) = then it is on the circle. f(,) > then it is outside the circle. f(,) < then it is inside the circle. 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 8 8
9 7//7 The first thing we can notice to mae our circle drawing algorithm more efficient is that circles centred at (, ) have eight-wa smmetr (-, ) (, ) (-, ) (, ) (-, -) R (, -) (-, -) (, -) 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 9 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP The equation for a circle is: r where r is the radius of the circle So, we can write a simple circle drawing algorithm b solving the equation for at unit intervals using: r //7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP This is not a brilliant solution! It has large gaps where the slope approaches the vertical. The calculations are not ver efficient The square (multipl) operations The square root operation tr reall hard to avoid these! We need a more efficient, more accurate solution X=r*cosθ+ c Y=r*sinθ+ c º θ 6º Or θ 6.8(*π) Problem: Deciding the increment in θ Cos, sin calculations 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 9
10 7//7 Similarl to the case with lines, there is an incremental algorithm for drawing circles the mid-point circle algorithm In the mid-point circle algorithm we use eight-wa smmetr so onl ever calculate the points for the top right eighth of a circle, and then use smmetr to get the rest of the points The mid-point circle a l g o r i t h m w a s developed b Jac Bresenham, who we heard about earlier. Bresenham s patent for the algorithm can USJP be v i e w e d here. 6 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of d old = F( p +, p +.) If d old <, E is chosen d new = F( p +, p -.) = d old +( p +) Delta E = p + If d old >=, SE is chosen d new = F( p +, p -.) = d old +( p - p +) Delta SE = p - p + Initialization d init = / R = - R 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 7 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 8 6 M 6 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 9 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6
11 7//7 M 6 Assume that we have (, ) just plotted point (, ) The net point is a choice between ( +, ) and ( +, -) We would lie to choose the point that is nearest to the actual circle So how do we mae this choice? ( +, ) ( +, -) 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6 Let s re-jig the equation of the circle slightl to give us: (, ) r f circ The equation evaluates as follows: f circ, if (, ) is inside the circle boundar (, ), if (, ) is on thecircle boundar, if (, ) is outsidethecircle boundar B evaluating this function at the midpoint between the candidate piels we can mae our decision Assuming we have just plotted the piel at (, ) so we need to choose between ( +, ) and ( +, -) Our decision variable can be defined as: p f circ ( (, ) ) ( ) If p < the midpoint is inside the circle and and the piel at is closer to the circle Otherwise the midpoint is outside and - is closer r 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6 To ensure things are as efficient as possible we can do all of our calculations incrementall First consider: or: p f circ [(, r where + is either or - depending on the sign of p ) ] p p ( ) ( ) ( ) 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 6 The first decision variable is given as: p fcirc r (, ) r ( ) r r Then if p < then the net decision variable is given as: p p If p > then the decision variable is: p p 7//7 Kasun@dscs.sjp.ac.l - Facult of Applied Sciences of USJP 66
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 informationComputer 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 informationCS 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 informationScan 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 informationIn 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 informationOUTPUT 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 informationRendering. 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 informationComputer 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 informationComputer Graphics. Lecture 3 Graphics Output Primitives. Somsak Walairacht, Computer Engineering, KMITL
Computer Graphics Lecture 3 Graphics Output Primitives Somsa Walairacht, Computer Engineering, KMITL Outline Line Drawing Algorithms Circle-, Ellipse-Generating Algorithms Fill-Area Primitives Polgon Fill
More informationCS 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 informationProf. 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 informationRendering. 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 informationComputer Graphics. Computer Graphics. Lecture 3 Line & Circle Drawing
Comuter Grahics Comuter Grahics Lecture 3 Line & Circle Drawing Comuter Grahics Towards the Ideal Line We can onl do a discrete aroimation Illuminate iels as close to the true ath as ossible, consider
More informationOpenGL 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 informationCPSC / 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 informationRaster 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 informationRasterization: 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(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 informationRendering. Basic Math Review. Rasterizing Lines and Polygons Hidden Surface Remove Multi-pass Rendering with Accumulation Buffers.
Rendering Rasterizing Lines and Polygons Hidden Surface Remove Multi-pass Rendering with Accumulation Buffers Basic Math Review Slope-Intercept Formula For Lines Given a third point on the line: P = (X,Y)
More informationOverview 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 informationScan Conversion. Lines and Circles
Scan Conversion Lines and Circles (Chapter 3 in Foley & Van Dam) 2D Line Implicit representation: αx + βy + γ = 0 Explicit representation: y y = mx+ B m= x Parametric representation: x P= y P = t y P +
More informationLine 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 information12.4 The Ellipse. Standard Form of an Ellipse Centered at (0, 0) (0, b) (0, -b) center
. The Ellipse The net one of our conic sections we would like to discuss is the ellipse. We will start b looking at the ellipse centered at the origin and then move it awa from the origin. Standard Form
More informationComputer Graphics: Line Drawing Algorithms
Computer Graphics: Line Drawing Algorithms 1 Graphics hardware The problem scan conversion Considerations Line equations Scan converting algorithms A very simple solution The DDA algorithm, Bresenham algorithm
More informationModule 2, Section 2 Graphs of Trigonometric Functions
Principles of Mathematics Section, Introduction 5 Module, Section Graphs of Trigonometric Functions Introduction You have studied trigonometric ratios since Grade 9 Mathematics. In this module ou will
More informationFrom 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 informationOutput 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 informationMODULE - 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 informationComputer 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 informationGraphics 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 informationCS 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 informationScan 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 informationRealtime 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 informationPolar 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 informationUNIT 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 informationDepartment 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 informationUNIT -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 informationEfficient 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 informationComputer 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 informationRaster Graphics Algorithms
Overview of Grahics Pieline Raster Grahics Algorithms D scene atabase traverse geometric moel transform to worl sace transform to ee sace scan conversion Line rasterization Bresenham s Mioint line algorithm
More informationTHE INVERSE GRAPH. Finding the equation of the inverse. What is a function? LESSON
LESSON THE INVERSE GRAPH The reflection of a graph in the line = will be the graph of its inverse. f() f () The line = is drawn as the dotted line. Imagine folding the page along the dotted line, the two
More informationRasterization, 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 informationOutput 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 informationSection 4.2 Graphing Lines
Section. Graphing Lines Objectives In this section, ou will learn to: To successfull complete this section, ou need to understand: Identif collinear points. The order of operations (1.) Graph the line
More informationTó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 informationGraphs, Linear Equations, and Functions
Graphs, Linear Equations, and Functions. The Rectangular R. Coordinate Fractions Sstem bjectives. Interpret a line graph.. Plot ordered pairs.. Find ordered pairs that satisf a given equation. 4. Graph
More informationComputer 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 informationCS 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 informationChapter - 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 informationLines and Their Slopes
8.2 Lines and Their Slopes Linear Equations in Two Variables In the previous chapter we studied linear equations in a single variable. The solution of such an equation is a real number. A linear equation
More information1 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 information20 Calculus and Structures
0 Calculus and Structures CHAPTER FUNCTIONS Calculus and Structures Copright LESSON FUNCTIONS. FUNCTIONS A function f is a relationship between an input and an output and a set of instructions as to how
More informationComputer 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 informationOutput 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 informationImplicit differentiation
Roberto s Notes on Differential Calculus Chapter 4: Basic differentiation rules Section 5 Implicit differentiation What ou need to know alread: Basic rules of differentiation, including the chain rule.
More informationCS 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 informationFrom 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 informationChapter 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 informationTwo 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 informationa 2 + 2a - 6 r r 2 To draw quadratic graphs, we shall be using the method we used for drawing the straight line graphs.
Chapter 12: Section 12.1 Quadratic Graphs x 2 + 2 a 2 + 2a - 6 r r 2 x 2 5x + 8 2 2 + 9 + 2 All the above equations contain a squared number. The are therefore called quadratic expressions or quadratic
More information2.1 The ReCTAngUlAR COORdInATe SySTemS And graphs
7 CHAPTER equations ANd inequalities learning ObjeCTIveS In this section ou will: Plot ordered pairs in a Cartesian coordinate sstem. Graph equations b plotting points. Graph equations with a graphing
More informationComputer 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 informationChapter 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 informationComputer 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 information0. 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 informationof Straight Lines 1. The straight line with gradient 3 which passes through the point,2
Learning Enhancement Team Model answers: Finding Equations of Straight Lines Finding Equations of Straight Lines stud guide The straight line with gradient 3 which passes through the point, 4 is 3 0 Because
More informationCSCI 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 informationA 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(0, 4) Figure 12. x + 3. d = c. = b. Figure 13
80 CHAPTER EQUATIONS AND INEQUALITIES Plot both points, and draw a line passing through them as in Figure. Tr It # _, 0 Figure Find the intercepts of the equation and sketch the graph: = _ +. (0, (This
More informationScan 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 informationR 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 informationAn 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 informationFunctions: The domain and range
Mathematics Learning Centre Functions: The domain and range Jackie Nicholas Jacquie Hargreaves Janet Hunter c 6 Universit of Sdne Mathematics Learning Centre, Universit of Sdne Functions In these notes
More informationFunctions Review Packet from November Questions. 1. The diagrams below show the graphs of two functions, y = f(x), and y = g(x). y y
Functions Review Packet from November Questions. The diagrams below show the graphs of two functions, = f(), and = g()..5 = f( ) = g( ).5 6º 8º.5 8º 6º.5 State the domain and range of the function f; the
More information8.5 Quadratic Functions and Their Graphs
CHAPTER 8 Quadratic Equations and Functions 8. Quadratic Functions and Their Graphs S Graph Quadratic Functions of the Form f = + k. Graph Quadratic Functions of the Form f = - h. Graph Quadratic Functions
More informationPARAMETRIC EQUATIONS AND POLAR COORDINATES
10 PARAMETRIC EQUATIONS AND POLAR COORDINATES PARAMETRIC EQUATIONS & POLAR COORDINATES A coordinate system represents a point in the plane by an ordered pair of numbers called coordinates. PARAMETRIC EQUATIONS
More informationLESSON 3.1 INTRODUCTION TO GRAPHING
LESSON 3.1 INTRODUCTION TO GRAPHING LESSON 3.1 INTRODUCTION TO GRAPHING 137 OVERVIEW Here s what ou ll learn in this lesson: Plotting Points a. The -plane b. The -ais and -ais c. The origin d. Ordered
More informationLine 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 informationLine 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 informationPoints 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 informationGraphics (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 informationUnit 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 informationDigital 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 informationRenderer 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 informationSTRAND G: Relations, Functions and Graphs
UNIT G Using Graphs to Solve Equations: Tet STRAND G: Relations, Functions and Graphs G Using Graphs to Solve Equations Tet Contents * * Section G. Solution of Simultaneous Equations b Graphs G. Graphs
More information4.7 INVERSE TRIGONOMETRIC FUNCTIONS
Section 4.7 Inverse Trigonometric Functions 4 4.7 INVERSE TRIGONOMETRIC FUNCTIONS NASA What ou should learn Evaluate and graph the inverse sine function. Evaluate and graph the other inverse trigonometric
More informationGetting a New Perspective
Section 6.3 Polar Coordinates Getting a New Perspective We have worked etensively in the Cartesian coordinate system, plotting points, graphing equations, and using the properties of the Cartesian plane
More informationAnnouncements. 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 informationDouble Integrals in Polar Coordinates
Double Integrals in Polar Coordinates. A flat plate is in the shape of the region in the first quadrant ling between the circles + and +. The densit of the plate at point, is + kilograms per square meter
More informationChapter 1 Notes, Calculus I with Precalculus 3e Larson/Edwards
Contents 1.1 Functions.............................................. 2 1.2 Analzing Graphs of Functions.................................. 5 1.3 Shifting and Reflecting Graphs..................................
More informationName: Thus, y-intercept is (0,40) (d) y-intercept: Set x = 0: Cover the x term with your finger: 2x + 6y = 240 Solve that equation: 6y = 24 y = 4
Name: GRAPHING LINEAR INEQUALITIES IN TWO VARIABLES SHOW ALL WORK AND JUSTIFY ALL ANSWERS. 1. We will graph linear inequalities first. Let us first consider 2 + 6 240 (a) First, we will graph the boundar
More informationCS 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 informationEquations and Inequalities
Equations and Inequalities Figure CHAPTER OUTLINE. The Rectangular Coordinate Sstems and Graphs. Linear Equations in One Variable. Models and Applications. Comple Numbers. Quadratic Equations.6 Other Tpes
More informationRaster Scan Displays. Framebuffer (Black and White)
Raster Scan Displays Beam of electrons deflected onto a phosphor coated screen Phosphors emit light when excited by the electrons Phosphor brightness decays -- need to refresh the display Phosphors make
More informationIntegrating ICT into mathematics at KS4&5
Integrating ICT into mathematics at KS4&5 Tom Button tom.button@mei.org.uk www.mei.org.uk/ict/ This session will detail the was in which ICT can currentl be used in the teaching and learning of Mathematics
More informationTransformations of Functions. 1. Shifting, reflecting, and stretching graphs Symmetry of functions and equations
Chapter Transformations of Functions TOPICS.5.. Shifting, reflecting, and stretching graphs Smmetr of functions and equations TOPIC Horizontal Shifting/ Translation Horizontal Shifting/ Translation Shifting,
More informationUsing 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 informationIntroduction to Trigonometric Functions. Peggy Adamson and Jackie Nicholas
Mathematics Learning Centre Introduction to Trigonometric Functions Pegg Adamson and Jackie Nicholas c 998 Universit of Sdne Acknowledgements A significant part of this manuscript has previousl appeared
More informationGeometry. Origin of Analytic Geometry. Slide 1 / 202 Slide 2 / 202. Slide 4 / 202. Slide 3 / 202. Slide 5 / 202. Slide 6 / 202.
Slide 1 / Slide / Geometr Analtic Geometr 1-- www.njctl.org Slide 3 / Table of Contents Origin of Analtic Geometr The Distance Formula The Midpoint Formula Partitions of a Line Segment Slopes of Parallel
More informationParametric Equations: Motion in a Plane Notes for Section 6.3. are parametric equations for the curve.
Parametric Equations: Motion in a Plane Notes for Section 6.3 In Laman s terms: Parametric equations allow us to put and into terms of a single variable known as the parameter. Time, t, is a common parameter
More information