
3.1 Software Rendering 157
P
1
P
1
P
3
P
0
P
2
P
5
P
3
P
6
P
4
P
0
P
4
P
2
e = 1
e = 2
e = 2
e = 0
e = 1
e = 0
e = 0
e = 0
e = 0
e = 2
e = 2
e = 2
(a) (b)
Figure 3.2 (a) A triangle clipped by one edge of a rectangle. (b) A triangle clipped by two edges
of a rectangle.
terpolate); call them P
m
and P
m+1
. The polygon indices, in order, are m, f ,...,,
m + 1. During the clipping, these indices are stored in the temporary array
aiCIndex.
Once clipping is finished,
aiCIndex is copied to aiIndex for use in clipping by the next
plane.
Now for an explanation about the input array
aiEdge to the function ClipPolygon
and its temporary array counterpart, aiEIndex. Figure 3.2 shows two configurations
for ...