Graphics Reference
In-Depth Information
We also need to recognise the conditions when such an intersection can arise. An intersection
with the z
min
end cap occurs when z
1
and z
2
are either side of the z
min
plane. Similarly, an
intersection with the z
max
end cap occurs when z
1
and z
2
are either side of the z
max
plane.
We have already examined the intersection of a line with a plane in Section 6.7 and discovered
that given a line
p
=
t
+
v
and a plane equation
ax
+
by
+
cz
=
d
where
n
=
a
i
+
b
j
+
c
k
=
−
n
·
t
+
d
n
·
v
If we place a plane at z
min
, we have
d
=
z
min
and
n
=−
k
and
3
=
−
−
z
T
+
z
min
z
min
−
z
T
=
−
z
v
z
v
3
can now be used to reveal the intersection point using
=
+
p
t
3
v
If we place a plane at z
max
, we have
d
=
z
max
and
n
=−
k
and
4
=
−
−
z
T
+
z
max
z
max
−
z
T
=
−
z
v
z
v
4
can now be used to reveal the intersection point using
p
=
t
+
4
v
Note that both end cap normals are pointing towards the origin.