CS488
Polygon Filling, Point and Line Clipping
Luc RENAMBOT
1
CS488 Polygon Filling, Point and Line Clipping Luc R ENAMBOT 1 - - PowerPoint PPT Presentation
CS488 Polygon Filling, Point and Line Clipping Luc R ENAMBOT 1 Last time How line segments are drawn into the frame buffer Began to talk about how polygons are filled in the frame buffer. Today: more about filling polygons and
Luc RENAMBOT
1
2
3
edges of polygon
4
5
6
7
Height-1
F A B C D E
Page 92
8
7 5 3 1
Height-1
EF
Page 98
3 7
9 2
7
11 7
1.5 -
5 7
1.5 -
DE CD FA AB BC
F A B C D E
Ymax - Xmin - 1/m - Next
9
Y value in ET (index of first nonempty bucket)
Ymin = y into AET (new edges)
for new y value)
10
11
12
13
14
15
16
17
18
19
→Nothing or single point
→Nothing or single line segment
→Nothing or single rectangle
→Nothing or single convex polygon
→Nothing or 1 or more concave polygons
20
21
22
(X,Y)
(Xmin,Ymin)
(Xmax,Ymax)
23
(Xmin,Ymin) (Xmax,Ymax)
P1 P2 P3 P4 P5 P6 P8 P7 P9 P10
24
P1 P2 P3 P4 P5 P6 P8 P7 P9 P10
25
(Xmin,Ymin) (Xmax,Ymax)
P3 P4 P5 P6 P9 P10
is enough
rejected
26
9 regions
Ymax)
Ymin)
27
28
(Xmin,Ymin) (Xmax,Ymax)
1st bit = Y > Ymax 2nd bit = Y < Ymin 3rd bit = X > Xmax 4th bit = X < Xmin
the clip rectangle
29
The full algorithm is given (in C) in the white book as figure 3.41 on p.116
30
31
A B C D E F G H I clipping rectangle