Game Development Reference
In-Depth Information
Just as for any system of linear equations, there are three solution pos-
sibilities (as illustrated in Figure A.4):
There is one solution . In this case, the denominators in (A.3) will be
nonzero.
There are no solutions . This indicates that the lines are parallel and
not intersecting. The denominators are zero.
There are an infinite number of solutions . This is the case when the
two lines are coincident. All the numerators and denominators are
zero in this case.
Figure A.4
Intersection of two lines in
2D—the three cases
A.8
Intersection of Two Rays in 3D
Given two rays in 3D defined parametrically by
r 1 (t 1 ) = p 1 + t 1 d 1 ,
r 2 (t 2 ) = p 2 + t 2 d 2 ,
we can solve for their point of intersection. For a moment, let us not restrict
the range of t 1 and t 2 ; therefore, we consider the infinite lines that contain
the rays. The delta vectors d 1 and d 2 do not necessarily have to be unit
vectors. If the rays lie in a plane, then we have the same three cases possible
as in the previous section:
The rays intersect at exactly one point.
The rays are parallel, and there is no intersection.
Search WWH ::




Custom Search