Game Development Reference
In-Depth Information
p 0 is the origin of the ray, u is the direction of the ray, and t is the
parameter. By plugging in different values for t , we compute different
points on the ray. The parameter t must be in the interval [0, )to
describe a ray. Values less than zero will generate points behind the ray
(that is, on the line that the ray is on). In fact, if we let t (- , ), then
we have a line in 3-space.
Ray/Plane Intersection
Given a ray p ( t )= p 0 + t u and a plane n p + d = 0, we would like to
know if the ray intersects the plane and the point of intersection. To do
this, we plug the ray into the plane equations and solve for the parame-
ter t that satisfies the plane equation, giving us the parameter that
yields the intersection point.
Plugging equation (9) into the plane equation:
Plug ray into plane equation
n
p
t
d
0
n
p
t u
d
0
0
n
p
n
t u
d
0
Distributive property
0
n
t
u
d
n
p
0
0
t
n
u
d
n
p
Associative property
d
n
p
t
0
Solve for t .
n
u
If t is not in the interval [0, ), the ray does not intersect the plane.
If t is in the interval [0, ), the intersection point is found by plug-
ging the parameter that satisfies the plane equation into the ray
equation:
d
n
p
d
n
p
0
0
p
p
u
0
n
u
n
u
Search WWH ::




Custom Search