
542 Chapter 11 Intersection in 3D
1. Project the triangle vertices V
0,i
onto L:
V
0,i
=
d · (V
0,i
− P), i ∈{0, 1, 2}
2. Compute t
0,0
and t
0,1
as follows:
t
0,i
= V
0,i
+ (V
0,2
− V
0,i
)
dist
V
0,i
dist
V
0,i
− dist
V
0,2
, i ∈{0, 1}
If the actual intersection line segment is desired, then we can find the overlapping
interval by inspecting t
0,0
, t
0,1
, t
1,0
, and t
1,1
, and then plugging the parameter values
back into the equation for L.
An outline of the entire algorithm is as follows:
1. Determine if either T
0
or T
1
(or both) are degenerate, and handle in application-
dependent fashion (this may mean exiting the intersection algorithm, or not).
2. Compute the plane equation of T
0
.
3. Compute the signed distances dist
V
1,i
, i ∈{0, 1, 2}, of the vertices of T
1
.
4. Compare the signs of dist
V
1,i
, i ∈{0, 1, 2}: if they are all the same, return false;
otherwise, proceed to the next step.
5. Compute the plane equation of T
1
.
6. If the plane equations of P
0
and P
1
are the same (or rather, within 1), then
compare the d values to see if the planes are coincident (within 1):
– If coincident, then project the triangles onto the axis-aligned lane that is most
nearly oriented with the triangles’ plane, and perform a 2D triangle intersec-
tion test.
3
– Otherwise, the parallel planes are not coincident, so no possible intersection;
exit the algorithm.
7. Compare the signs of dist
V
0,i
, i ∈{0, 1, 2}: if they are all the same, return false;
otherwise, proceed to the next step.
8. Compute intersection line.
9. Compute intervals.
– If no interval overlap, triangles don’t intersect. Return false.
– Otherwise, if intersecting line segment is required, compute it. In any case,
return true.
3. The method of separating axes (Section 7.7) can be used to determine whether or not an
intersection exists. Generally speaking, the intersection of two 2D triangles will be one or
more line segments (which may degenerate to a point); if this information is required (rather
than merely determining whether or not an intersection exists), then we can compute the
intersection of each edge of each triangle against the other triangle.