Scan conversion lines circles and ellipse
This presentation is the property of its rightful owner.
Sponsored Links
1 / 17

Scan Conversion, Lines, Circles and Ellipse PowerPoint PPT Presentation


  • 172 Views
  • Uploaded on
  • Presentation posted in: General

Scan Conversion, Lines, Circles and Ellipse. Dr. Aree Ali Mohammed Assistant Professor 2014-2015 3 rd Stage [email protected] Constructing 2D Objects in Computer Graphics. Points. Polygone. Line. Rectangle. Square. Triangle. r. Ellipse. (0, 0). C ircle. Curve.

Download Presentation

Scan Conversion, Lines, Circles and Ellipse

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Scan conversion lines circles and ellipse

Scan Conversion,Lines, Circles and Ellipse

Dr. Aree Ali Mohammed

Assistant Professor

2014-2015

3rdStage

[email protected]

University of Sulaimani– Computer Science Dept.


Constructing 2d objects in computer graphics

Constructing 2D Objects in Computer Graphics

Points

Polygone

Line

Rectangle

Square

Triangle

r

Ellipse

(0, 0)

Circle

Curve


Constructing 3d objects in computer graphics

Constructing 3D Objects in Computer Graphics


Scan conversion lines circles and ellipse

Scan Conversion or Rasterization

  • Drawing lines, circles, and etc. on a grid implicitly involves approximation.

  • The general process: Scan Conversion or Rasterization

  • Ideally, the following properties should be considered

    • smooth

    • continuous

    • pass through specified points

    • uniform brightness

    • efficient


Scan conversion lines circles and ellipse

Line Drawing Algorithms


Scan conversion lines circles and ellipse

Line Drawing Algorithms


Scan conversion lines circles and ellipse

Line Drawing Algorithms


Scan conversion lines circles and ellipse

Line Drawing Algorithms


Scan conversion lines circles and ellipse

DDA - Line Drawing Algorithms


Scan conversion lines circles and ellipse

DDA - Line Drawing Algorithms


Scan conversion lines circles and ellipse

DDA - Line Drawing Example


Scan conversion lines circles and ellipse

Bresenham’s Line Algorithm


Scan conversion lines circles and ellipse

Bresenham’s Line – Example


Scan conversion lines circles and ellipse

Review Questions and Homework

  • Explain the steps in the incremental line drawing algorithm.

  • Explain the steps in DDA line drawing algorithm.

  • Explain the steps in Bresenham’s line drawing algorithm.

  • HW/

  • Draw the following lines using DDA and Bresenham:

  •  (from left to right):

  •  (-1, 2) and (7, 8)

  •  (1, -3) and (6, 5)

  •  (from right to left)

  •  (6, 2) and (-4, -3)

  •  (9, 4) and (2, -5)


Scan conversion lines circles and ellipse

  • Scan Converting CirclesExampl

Midpoint Circle Algorithm

1. Input radius r and circle center (xc,yc) and obtain the first point on the circumference of the circle centered on the origin as (x0, y0) = (0, r)

2. Calculate the initial value of the decision parameter as

Po=5/4-r or [po=1-r for r an integer]

3. At each xk position starting at k = 0 , perform the following test. If pk < 0 , the next point along the circle centered on (0, 0) is (xk+1, yk) and

pk+1 = pk + (2xk+1) + 1

Otherwise the next point along the circle is (xk+1, yk-1) and

pk+1 = pk + (2xk+1) + 1 – (2yk+1)

Where 2xk+1 = 2xk+2 and 2yk+1 = 2yk – 2

4. Determine symmetry points in the other seven octants

5. Move each calculated pixel position (x,y) onto

the circular path centered on (xc, yc) and plot

the coordinate values

x = x+ xc , y= y+ yc

6. Repeat steps 3

through 5 until x >= y


Scan conversion lines circles and ellipse

  • Scan Converting CirclesExampl

Scan Converting Circle - Example


Reading list

Reading List

  • “Computer Graphics with OpenGL” , chapter 3.

  • Raster versus Vector

    http://www.sketchpad.net/basics1.htm


  • Login