CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics May 3, 2007.

Slides:



Advertisements
Similar presentations
Graphics Primitives: line
Advertisements

CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1 Emmanuel Agu.
Section 3-1 to 3-2, 3-5 Drawing Lines Some of the material in these slides may have been adapted from university of Virginia, MIT, and Åbo Akademi University.
4- 1 Raster Display Model Pixel (Picture Element, 像素 )
CS 376 Introduction to Computer Graphics 02 / 02 / 2007 Instructor: Michael Eckmann.
Computer Graphics 4: Bresenham Line Drawing Algorithm, Circle Drawing & Polygon Filling By:Kanwarjeet Singh.
1 King ABDUL AZIZ University Faculty Of Computing and Information Technology CS 454 Computer graphics Drawing Elementary Figures Dr. Eng. Farag Elnagahy.
CS 450: COMPUTER GRAPHICS REVIEW: DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE.
+ CPCS 391 Computer Graphics 1 Instructor: Dr. Sahar Shabanah Lecture 3.
Lecture 5 Rendering lines 1.Steps of line rendering 2.Scan-conversion for line segments 3.A1 tutorial CP411 Computer Graphics Fall 2007 Wilfrid Laurier.
Scan Conversion Algorithms
Scan conversion of Line , circle & ellipse
Line Drawing Algorithms. Rasterization-Process of determining which pixels give the best approximation to a desired line on the screen. Scan Conversion-Digitizing.
Larry F. Hodges (modified by Amos Johnson) 1 Design of Line, Circle & Ellipse Algorithms.
The lines of this object appear continuous However, they are made of pixels 2April 13, 2015.
CS 376 Introduction to Computer Graphics 01 / 29 / 2007 Instructor: Michael Eckmann.
Raster conversion algorithms for line and circle
Output Primitives Computer Graphics.
Implementation III Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
University of Missouri at Columbia 2D Scan-line Conversion University of Missouri at Columbia.
Line Drawing by Algorithm. Line Drawing Algorithms Line drawn as pixels Graphics system –Projects the endpoints to their pixel locations in the frame.
Bresenham’s Algorithm. Line Drawing Reference: Edward Angel’s book: –6 th Ed. Sections 6.8 and 6.9 Assuming: –Clipped (to fall within the window) –2D.
College of Computer and Information Science, Northeastern UniversitySeptember 12, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture.
IT- 601: Computer Graphics Lecture-03 Scan Conversion
1 CS 430/536 Computer Graphics I Circle Drawing and Clipping Week 3, Lecture 6 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent.
WHERE TO DRAW A LINE?? Line drawing is accomplished by calculating intermediate positions along the line path between specified end points. Precise definition.
Scan Conversion Line and Circle
Computing & Information Sciences Kansas State University CIS 536/636 Introduction to Computer Graphics Lecture 6 of 41 William H. Hsu Department of Computing.
Informationsteknologi Monday, November 26, 2007Computer Graphics - Class 121 Today’s class Drawing lines Bresenham’s algorithm Compositing Polygon filling.
Triangle Scan Conversion. 2 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Rasterization Rasterization (scan conversion) –Determine which.
1Computer Graphics Implementation III Lecture 17 John Shearer Culture Lab – space 2
Introduction to Computer Graphics with WebGL
CS 480/680 Computer Graphics Implementation III Dr. Frederick C Harris, Jr. Fall 2011.
10/15/02 (c) 2002 University of Wisconsin, CS559 Last Time Clipping.
Introduction Computer Graphics & Its application Types of computer graphics Graphic display : random Scan & Raster Scan display Frame buffer and video.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Image Synthesis Rabie A. Ramadan, PhD 7. 2 Image Rasterization.
10/15/02 (c) 2002 University of Wisconsin, CS559 Who Am I? Prof Stephen Chenney These notes will be online after the lecture – in fact they’re online already.
10/19/04© University of Wisconsin, CS559 Fall 2004 Last Time Clipping –Why we care –Sutherland-Hodgman –Cohen-Sutherland –Intuition for Liang-Barsky Homework.
CS 325 Introduction to Computer Graphics 02 / 03 / 2010 Instructor: Michael Eckmann.
1 CSCE 441 Lecture 2: Scan Conversion of Lines Jinxiang Chai.
1 Bresenham’s Circle Algorithm Define:D(s i ) = distance of p 3 from circle D(t i ) = distance of p 2 from circle i.e.D(s i ) = (x i + 1) 2 + y i 2 – r.
Scan Conversion.
Lecture 13: Raster Graphics and Scan Conversion
Lecture 2: 19/4/1435 Graphical algorithms Lecturer/ Kawther Abas CS- 375 Graphics and Human Computer Interaction.
Rasterization Overview Raster Display Device. Scan Conversion / Rasterization: converting vector graphics into raster graphics (determining pixels in.
Computer Graphics Inf4/MSc Computer Graphics Lecture 4 Line & Circle Drawing.
10/10/2006TCSS458A Isabelle Bichindaritz1 Line and Circle Drawing Algorithms.
Scan Conversion of Line Segments. What is Scan conversion? Final step of rasterization (the process of taking geometric shapes and converting them into.
Computer Graphics I, Fall 2010 Scan conversion algorithms.
Rasterization, or “What is glBegin(GL_LINES) really doing?” Course web page: February 23, 2012  Lecture 4.
Line Drawing Algorithms 1. A line in Computer graphics is a portion of straight line that extends indefinitely in opposite direction. 2. It is defined.
CSCE 441 Lecture 2: Scan Conversion of Lines
Computer graphics 2D graphics.
CS 4731: Computer Graphics Lecture 20: Raster Graphics Part 1
Lecture 8 Shear and Line Drawing Algorithms
University of New Mexico
Implementation III.
Prof. Harriet Fell Spring 2007 Lecture 5 – January 17, 2006
Chapter Three Part I Output Primitives CS 380.
Introduction to Computer Graphics with WebGL
CSCE 441 Lecture 2: Scan Conversion of Lines
2D Scan-line Conversion
Introduction to Computer Graphics
Rasterization and Antialiasing
Computer Graphics Implementation III
Rasterization and Antialiasing
Chapter 3 Graphics Output Primitives
Implementation III Ed Angel Professor Emeritus of Computer Science
Line Drawing Algorithms
Presentation transcript:

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 CS5500 Computer Graphics May 3, 2007

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 Today’s Topic Bresenham’s line drawing algorithm. Reference: Edward Angel’s book: –4 th Ed. Sections 7.8 and 7.9 –3 rd Ed. Sections 8.9 and 8.10.

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 Scan Conversion Also called rasterization. The 3D to 2D Projection gives us 2D vertices (points). We need to fill in the interior.

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 Line Drawing Assuming: –Clipped (to fall within the window) –2D screen coordinates –Each pixel covers a square region where is its center? Rounding (X, Y) implies center at (0.0, 0.0). Truncating implies center at (0.5, 0.5).

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 DDA Algorithm DDA stands for digital differential analyzer. The differential equation for a line is: m = dy / dx

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 Stepping in X direction

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 Bresenham’s Algorithm Improve upon DDA algorithm to use integer arithmetic only. Applicable to circle drawing too. We discuss only the line drawing here.

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 Decision Variables Variables a and b record the distances to the pixel centers of (i+1, j) and (i+1, j+1) If a > b, then y=j If a < b, then y= j+1

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 Integer Only If (x1, y1) and (x2, y2) are integer points, then  x * a and  x * b may be stored as integers as well. –Because a and b increase or decrease by m =  y /  x

CS5500 Computer Graphics © Chun-Fa Chang, Spring 2007 Using the Symmetry The above works when  x  0,  y  0, and  x   y. If  x <  y, then step in Y direction instead. It is easy to extend it to handle  x < 0 or  y < 0.