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

Size: px
Start display at page:

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

Transcription

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

2 Output Primitives Output Primitives: Basic geometric structures (points, straight line segment, circles and other conic sections, quadric surfaces, spline curve and surfaces, polygon color areas, and character strings) These picture components are often defined in a continuous space.

3 Output Primitives In order to draw the primitive objects, one has to first scan convert the object. Scan convert: Refers to he operation of finding out the location of pixels to the intensified and then setting the values of corresponding bits, in the graphic memory, to the desired intensity code.

4 Output Primitives Each pixel on the display surface has a finite size depending on the screen resolution and hence a pixel cannot represent a single mathematical point.

5 Scan Converting A Point

6 Scan Converting A Point A mathematical point (x,y) needs to be scan converted to a pixel at location (x, y ).

7 Scan Converting A Point x =Round(x) and y =Round(y) All points that satisfy: x x < x + 1 are mapped to pixel (x,y ) y y y 1 < +

8 Scan Converting A Point x =Round(x+0.5) and y =Round(y+o.5) All points that satisfy: x 0.5 x < x are mapped to pixel (x,y ) y 0.5 y < y

9 Scan Converting A Line

10 Scan Converting A Line The Cartesian slope- intercept equation for a straight line is: x x y y m = b x m y + = 1 x 1 m y b = x m y = m y x =

11 Scan Converting A Line These equation form the basic for determining deflection voltage in analog devices. y = m x x = y m m <1 m >1

12 Scan Converting A Line On raster system, lines are plotted with pixels, and step size (horizontal & vertical direction) are constrained by pixel separation.

13 Scan Converting A Line We must sample a line at discrete positions and determine the nearest pixel to the line at each sampled position.

14 Digital Differential Analyzer (DDA Algorithm)

15 DDA Algorithm Algorithm is an incremental scan conversion method. Based on calculating either x or If m <1, ( x =1) y y = m x y = y + K +1 k m

16 DDA Algorithm If m >1, ( y = 1) y x = m 1 x =x + m K +1 k If ( x = 1) y = m x y K +1 = y m k

17 Bresenham s Line Algorithm

18 Bresenham s Line Algorithm A highly efficient incremental method for scan converting lines. Using only incremental integer calculation. By testing the sign of an integer parameter, whose value is proportional to the difference between the separation of two pixel positions from the actual line path.

19 Bresenham s Line Algorithm A highly efficient incremental method for scan converting lines. Using only incremental integer calculation. By testing the sign of an integer parameter, whose value is proportional to the difference between the separation of two pixel positions from the actual line path.

20 Bresenham s Line Algorithm

21 Bresenham s Line Algorithm

22 Bresenham s Line Algorithm y k+1 y y k } } d 2 d 1 x k+1

23 Bresenham s Line Algorithm d 1 = y - y k = m (x k + 1) + b - y k d 2 = (y k + 1) - y = y k m (x k + 1) b d 1 -d 2 = 2 m (x k + 1) - 2 y k + 2b -1

24 Bresenham s Line Algorithm P k = X ( d 1 -d 2 ) = 2 Y. x k -2 X. y k + c c = constante = 2 Y + X (2b -1)

25 Let's get rid of multiplications P k+1 = 2 Y. x k+1-2 X.y + c P k+1 -P k = 2 Y (x k+1 -x k ) -2 X (y k+1 -y k ) (get rid of the constance) P k+1 = P k + 2 Y - 2 X (y k+1 -y k ) P k+1 = P k + 2 Y or = P k + 2( Y X ) with (y k+1 -y k ) = 0 or 1 depending on P k sign

26 Bresenham s Line Algorithm P 0 = X (d 1 -d 2 ) = X[2m(x 0 +1)-2y 0 +2b-1] = X[2(mx 0 +b-y 0 )+2m-1] m= y/x 0 P 0 =2 Y - X

27 Bresenham s Line Algorithm Example: Digitize the line with endpoint (20,10) and (30,18) X=10 Y= 8 P0=2 Y x=6 2 Y =16 2( Y X)=-4 P0=2 Y X Pk+1 = Pk + 2 Y or = Pk + 2( Y X)

28 Circle Generation Algorithms

29 Circle Generation Algorithms The equation of a circle: We could solve for y in terms of x

30 Circle Generation Algorithms The spacing between plotted pixel positions is not uniform.

31 Circle Generation Algorithms Computation can be reduced by considering the symmetry of circles 8 -Way symmetry

32 Midpoint Circle Algorithm

33 Circle Generation Algorithms As in the line algorithm, we sample at unit intervals and determine the closet pixel position to the circle path at each step.

34 Circle Generation Algorithms Points are generated from 90º to 45º, moves will be made only in the +x and y direction. positive x direction over this octant and use a decision parameter

35 Circle Generation Algorithms We define a circle function: < 0 f ( x, y) = x 2 + y 2 r 2 = 0 circle > o

36 Circle Generation Algorithms Midpoint ( x i 1, y + i 1 ) 2 Consider the coordinates of the point halfway between pixel T and pixel S Midpoint

37 Circle Generation Algorithms We use it to define a decision parameter p i = f 1 ) 2 1 ) 2 ( x + 1, y = ( x + 1) 2 + ( y 2 r 2 i i i

38 Circle Generation Algorithms p i If is negative, the midpoint is inside the pixel, and we choose pixel T. < 0 If p 0 we choose pixel S. i

39 Circle Generation Algorithms Parameter for the next step is: p 1 = + 1) 2 + ( ) i+ 1 i+ 1 i+ 1 2 ( x y r 2 since x = x +1 i + 1 i

40 Circle Generation Algorithms If T is chosen ( ) we have: p i < 0 If pixel S is chosen ( ) we have p i 0

41 Circle Generation Algorithms In terms of

42 Circle Generation Algorithms Initial value for the decision parameter using the original function of (0,r) When r is an integer we can simply set

43 Circle Generation Algorithms

44 Circle Generation Algorithms int x = 0; int y = radius; int p = 1 - radius; circlepoints(xcenter, ycenter, x, y, pix); while (x < y) { x++; if (p < 0) { p += 2*x+1; } else { y--; p += 2*(x-y+1); } circlepoints(xcenter, ycenter, x, y, pix); }

45 Circle Generation Algorithms Example: A circle radius r=10 x=0 to x=y P 0 =1-r = -9

46 Exercises

47 1. Scan Converting Arcs And Sectors?

48 Character Generation

49 Character Generation Letters, numbers, and other character can be displayed in a variety of size and styles.

50 Character Generation Typeface: The overall design style for a set of characters is call typeface: Zar, nazanin, Titr. Font: Referred to a set of cast metal character forms in a particular size and forma: 10 point Zar.

51 Character Generation Two different representation are used for storing computer fonts: 1. Bitmap font (or bitmapped font) 2. Outline font

52 Bitmap font Bitmap font (or bitmapped font): A simple method for representing the character shapes in a particular typeface is to use rectangular grid pattern.

53 Bitmap font The character grid only need to be mapped to a frame buffer position. Bitmap fonts required more space, because each variation (size and format) must be stored in a font cash. Bold Italic

54 Outline Font Graphic primitives such as lines and arcs are used to define the outline of each character. Require less storage since variation does not require a distinct font cash.

55 Outline Font We can produce boldface, italic, or different size by manipulating the curve definition for the character outlines. It does take more time to process the outline fonts, because they must be scan converted into frame buffer.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Rendering. A simple X program to illustrate rendering

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

More information

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

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

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

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

More information

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

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

More information

CSCI 4620/8626. Coordinate Reference Frames

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

More information

OUTPUT PRIMITIVES. 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Raster Scan Displays. Framebuffer (Black and White)

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

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

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

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

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

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

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

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

A is any set of ordered pairs of real numbers. This is a set of ordered pairs of real numbers, so it is a.

A is any set of ordered pairs of real numbers. This is a set of ordered pairs of real numbers, so it is a. Fry Texas A&M University!! Math 150!! Chapter 3!! Fall 2014! 1 Chapter 3A Rectangular Coordinate System A is any set of ordered pairs of real numbers. A relation can be finite: {(-3, 1), (-3, -1), (0,

More information

CS2401 Computer Graphics

CS2401 Computer Graphics UNIT I - 2D PRIMITIVES Output primitives Line, Circle and Ellipse drawing algorithms - Attributes of output primitives Two dimensional Geometric transformation - Two dimensional viewing Line, Polygon,

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

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

2D Image Synthesis. 2D image synthesis. Raster graphics systems. Modeling transformation. Vectorization. u x u y 0. o x o y 1

2D Image Synthesis. 2D image synthesis. Raster graphics systems. Modeling transformation. Vectorization. u x u y 0. o x o y 1 General scheme of a 2D CG application 2D Image Synthesis Balázs Csébfalvi modeling image synthesis Virtual world model world defined in a 2D plane Department of Control Engineering and Information Technology

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

Computer Graphics: 6-Rasterization

Computer Graphics: 6-Rasterization Computer Graphics: 6-Rasterization Prof. Dr. Charles A. Wüthrich, Fakultät Medien, Medieninformatik Bauhaus-Universität Weimar caw AT medien.uni-weimar.de Raster devices In modern devices the smallest

More information

with a Digital Differential Algorithm tom/lecture-notes/graphics/dda-circle/dda-circle.

with a Digital Differential Algorithm  tom/lecture-notes/graphics/dda-circle/dda-circle. to Draw a Circle with a Digital Differential Algorithm http://csustan.csustan.edu/ tom Tom Carter Computer Science CSU Stanislaus tom@csustan.csustan.edu http://csustan.csustan.edu/ tom/lecture-notes/graphics/dda-circle/dda-circle.pdf

More information

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

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

More information

UNIT 2 Scan Conversion Techniques and Image Representation Unit-02/Lecture-01

UNIT 2 Scan Conversion Techniques and Image Representation Unit-02/Lecture-01 UNIT 2 Scan Conversion Techniques and Image Representation Unit-02/Lecture-01 Scan Conversion [RGPV/DEC-2008(10)] Scan conversion or scan rate converting is a technique for changing the vertical / horizontal

More information

Department of Computer Science Engineering, Mits - Jadan, Pali, Rajasthan, India

Department of Computer Science Engineering, Mits - Jadan, Pali, Rajasthan, India International Journal of Scientific Research in Computer Science, Engineering and Information Technology 2018 IJSRCSEIT Volume 3 Issue 1 ISSN : 2456-3307 Performance Analysis of OpenGL Java Bindings with

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

CS6504 & Computer Graphics Unit I Page 1

CS6504 & Computer Graphics Unit I Page 1 Introduction Computer contains two components. Computer hardware Computer hardware contains the graphics workstations, graphic input devices and graphic output devices. Computer Software Computer software

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

1 Some easy lines (2, 17) (10, 17) (18, 2) (18, 14) (1, 5) (8, 12) Check with a ruler. Are your lines straight?

1 Some easy lines (2, 17) (10, 17) (18, 2) (18, 14) (1, 5) (8, 12) Check with a ruler. Are your lines straight? 1 Some easy lines Computers draw images using pixels. Pixels are the tiny squares that make up the image you see on computer monitors. If you look carefully at a computer screen with a magnifying glass,

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

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

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

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

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

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

CS-321 Thursday 12 September 2002 Quiz (3 pts.) What is the purpose of a control grid in a cathode ray tube (CRT)?

CS-321 Thursday 12 September 2002 Quiz (3 pts.) What is the purpose of a control grid in a cathode ray tube (CRT)? Name CS-321 Thursday 12 September 2002 Quiz 1 1. (3 pts.) What is the purpose of a control grid in a cathode ray tube (CRT)? 2. (7 pts.) For the same resolution in pixels (for example, 640x480), why does

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

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

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

Direction Fields; Euler s Method

Direction Fields; Euler s Method Direction Fields; Euler s Method It frequently happens that we cannot solve first order systems dy (, ) dx = f xy or corresponding initial value problems in terms of formulas. Remarkably, however, this

More information

More Raster Line Issues. Bresenham Circles. Once More: 8-Pt Symmetry. Only 1 Octant Needed. Spring 2013 CS5600

More Raster Line Issues. Bresenham Circles. Once More: 8-Pt Symmetry. Only 1 Octant Needed. Spring 2013 CS5600 Spring 03 Lecture Set 3 Bresenham Circles Intro to Computer Graphics From Rich Riesenfel Spring 03 More Raster Line Issues Fat lines with multiple pixel with Symmetric lines n point geometry how shoul

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

Each point P in the xy-plane corresponds to an ordered pair (x, y) of real numbers called the coordinates of P.

Each point P in the xy-plane corresponds to an ordered pair (x, y) of real numbers called the coordinates of P. Lecture 7, Part I: Section 1.1 Rectangular Coordinates Rectangular or Cartesian coordinate system Pythagorean theorem Distance formula Midpoint formula Lecture 7, Part II: Section 1.2 Graph of Equations

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

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

UNIT I INTRODUCTION. Survey of Computer Graphics

UNIT I INTRODUCTION. Survey of Computer Graphics CS6504 COMPUTER GRAPHICS UNIT I INTRODUCTION Survey of computer graphics, Overview of graphics systems Video display devices, Raster scan systems, Random scan systems, Graphics monitors and Workstations,

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

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

Section 1.1 The Distance and Midpoint Formulas

Section 1.1 The Distance and Midpoint Formulas Section 1.1 The Distance and Midpoint Formulas 1 y axis origin x axis 2 Plot the points: ( 3, 5), (0,7), ( 6,0), (6,4) 3 Distance Formula y x 4 Finding the Distance Between Two Points Find the distance

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

Pipeline implementation II

Pipeline implementation II Pipeline implementation II Overview Line Drawing Algorithms DDA Bresenham Filling polygons Antialiasing Rasterization Rasterization (scan conversion) Determine which pixels that are inside primitive specified

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

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

Fall CSCI 420: Computer Graphics. 7.1 Rasterization. Hao Li.

Fall CSCI 420: Computer Graphics. 7.1 Rasterization. Hao Li. Fall 2015 CSCI 420: Computer Graphics 7.1 Rasterization Hao Li http://cs420.hao-li.com 1 Rendering Pipeline 2 Outline Scan Conversion for Lines Scan Conversion for Polygons Antialiasing 3 Rasterization

More information

Implementation III. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Implementation III. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Implementation III Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico Objectives Survey Line Drawing Algorithms - DDA - Bresenham 2 Rasterization

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

The Traditional Graphics Pipeline

The Traditional Graphics Pipeline Last Time? The Traditional Graphics Pipeline Participating Media Measuring BRDFs 3D Digitizing & Scattering BSSRDFs Monte Carlo Simulation Dipole Approximation Today Ray Casting / Tracing Advantages? Ray

More information

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY CS2401 COMPUTER GRAPHICS QUESTION BANK

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY CS2401 COMPUTER GRAPHICS QUESTION BANK CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING CS2401 COMPUTER GRAPHICS QUESTION BANK PART A UNIT I-2D PRIMITIVES 1. Define Computer graphics. 2. Define refresh

More information