696 Chapter 15 Intersection Methods
if (t > t1) then
cull the linear component; // Figure 15.6 (f)
else if (t > t0) then
t0 = t; // Figure 15.6 (e)
else
do nothing; // Figure 15.6 (d)
If x
d
= 0, the linear component is parallel to the x-faces. The component is either
outside the box, in which case it is culled, or inside or on the box, in which case no
clipping against the x-faces needs to be perfor med. The pseudocode is
n=e0-xp;
if (n < 0) then
cull the linear component;
else
do nothing;
A goal of the construction is to keep the clipping code to a minimum. With this in
mind, notice that the clipping code for the case x =e
0
and x
d
> 0 is the same as that
for the case x =−e
0
and x
d
< 0. The clipping code for the case x = e
0
and x
d
< 0
is the same as that for the