DDA PPT
DDA PPT
of
39
Output Primitives
• DDA Line Drawing Algorithm
• Bresenham’s Line Drawing Algorithm
• Midpoint Algorithm for Circle
• Midpoint Algorithm for Ellipse
• Scan line Polygon Fill Method
• Boundary Fill Algorithm
• Flood Fill Algorithm
2
of
39
Pixel
➢ Pixel or Pel is one of the many tiny dots that make
up the representation of a picture in a computer’s
memory.
- pix (picture)
- el (element)
➢ Pixel is a smallest controllable element of a picture
represented on a screen
• LE as SP RE as SP
xi +1 = xi + 1 xi +1 = xi − 1
yi +1 = yi + m yi +1 = yi − m
7
of
39
DDA Line drawing method
• Consider a line with positive slope > 1
y = mx
y
x =
m
• LE as SP RE as SP
xi +1 = xi + (1 m) xi +1 = xi − (1 m)
yi +1 = yi + 1 yi +1 = yi − 1
8
of
39
DDA Line drawing method
• Consider a line with negative slope |m|<=1
y = mx
y
x =
m
• LE as SP RE as SP
xi +1 = xi + 1 xi +1 = xi − 1
yi +1 = yi − m yi +1 = yi + m
9
of
39
DDA Line drawing method
• Consider a line with negative slope |m| > 1
y = mx
y
x =
m
• LE as SP RE as SP
xi +1 = xi + (1 m) xi +1 = xi − (1 m)
yi +1 = yi − 1 yi +1 = yi + 1
10
of
39
DDA Line drawing method
Line
Positive slope line Negative slope line
Left endpoint as Right endpoint as Left endpoint as Right endpoint as
starting point starting point starting point starting point
m≤1 m>1 m≤1 m>1 |m|≤1 |m|>1 |m|≤1 |m|>1