Presentation is loading. Please wait.

Presentation is loading. Please wait.

2D Scan-line Conversion

Similar presentations


Presentation on theme: "2D Scan-line Conversion"— Presentation transcript:

1 2D Scan-line Conversion
University of Missouri at Columbia

2 2D Scan-line Conversion
DDA algorithm Bresenham’s algorithm

3 DDA algorithm The simplest algorithm.
Named after Digital Differential Analyzer. (x1, y1) dy (x0, y0) dx

4 DDA Algorithm

5 DDA Algorithm

6 DDA Algorithm

7 DDA Algorithm

8 DDA Algorithm

9 DDA Algorithm

10 2D Scan-line Conversion
DDA algorithm Bresenham’s algorithm

11 Bresenham’s Midpoint Algorithm
DDA is simple, efficient, but needs floating points. Bresenham’s use integer addition only. (x1, y1) dy (x0, y0) dx

12 Bresenham’s Midpoint Algorithm
To choose from the two pixels NE or E depending on the relative position of the midpoint M and the line. Choose E if M is above the line, Choose NE if M is below the line. NE M E (x0, y0)

13 Bresenham’s Midpoint Algorithm
Choose E if d is positive, Choose NE if d is negative. NE M E (x0, y0)

14 Bresenham’s Midpoint Algorithm
Choose E if d is positive, Choose NE if d is negative. NE M E (x0, y0)

15 Incremental Calculation of the decision variable dnew
(x0, y0)

16 Bresenham’s Midpoint Algorithm
NE M E (x0, y0)


Download ppt "2D Scan-line Conversion"

Similar presentations


Ads by Google