Graphics Reference
In-Depth Information
6 Intersections
6.1 Introduction
In this chapter we explore how vector-based techniques are used to resolve a variety of problems
that arise in computer graphics such as proximity testing, modeling, collision detection, ray
casting, and ray tracing.
In some cases, as we shall see, we can work directly with vector-based equations without
incorporating extra transformations. For example, to compute the intersection of two lines, we
can work directly with the line equations. But say we wish to compute the intersection of a
cylinder with a line? Then it is highly likely that the cylinder will have to be scaled, rotated, and
translated away from the origin, in which case the cylinder's equations have to be transformed
before performing the intersection. Unfortunately, the resulting solution is neither simple nor
elegant. However, it just so happens that if we transform the line instead such that the relative
orientation between the line and cylinder is preserved, the geometric analysis remains both
simple and elegant.
For instance, let's assume that an object O is modeled such that its center is at the origin,
and then O is subjected to three transforms: S (scale), R (rotate), and T (translate) to produce
the transformed object O :
O
=
T
·
R
·
S
·
O
If we attempt to compute an intersection with O using a ray described by
p
=
t
+
v
the algebraic analysis becomes rather convoluted. However, if we leave the object where it is and
transform the ray instead, we just have to make sure that the ray is transformed such that the
relative orientation between the ray and the object is preserved. Basically, this requires finding
the inverse transforms of T R , and S :
T 1 R 1 and S 1
129
Search WWH ::




Custom Search