Line-Plane Intersection
|
|
|
STEP 1 : KNOWNS The equation of a line is: P = P0 + t(P1 – P0) - P is any arbitrary point on the line. In this case, P is the point of intersection of the ray and the plane - P0 is the starting point of the line - P1 is the end point of our line segment - t is the parameter. Values between 0 and 1 represent points on our line.
|
The equation of a plane is: N dot (P – P2) = 0 - N is the normal of the plane - P and P2 are known points on the plane. In this case, P will represent the point of intersection. If our plane was represented by a triangle, P2 could be one of the vertices.
|
STEP 2 : PLUG AND CHUG Plug the equation of the ray into our intersection pt of the equation of the plane. N dot ( (P0 + tV) – P2) = 0
Solve for t: (N dot (P0 + tV)) – (N dot P2) = 0 (N dot (P0 + tV)) = (N dot P2) (N dot P0) + (N dot tV) = (N dot P2) N dot tV = (N dot P2) - (N dot p0) t = N dot (p2 – p0) N dot V
Note: If N dot V = 0, then the line segment is perpendicular to the Normal of the plane, meaning the plane and line-segment are parallel, no intersection.
|
STEP 3 : FINISHING UP Now that you have t, plug it into our equation for a line: P = P0 + t(P1 – P0)
And you’ll get the coordinates of the intersection point |
Notes on T: If: t > 0 and t < 1 : The intersection occurs between the two end points t = 0 : The intersection falls on the first end point t = 1 : Intersection falls on the second end point t > 1 : Intersection occurs beyond second end Point t < 0 : Intersection happens before 1st end point.
|