View Full Version : Intersectionpoint of plane and ray

07-25-2002, 07:59 AM

i have two vectors (points), that lay on a ray, and a plane. I have the planes normal and its distance. Now i need to calculate where the ray intersects the plane.
I know how i would do it in school, but i cannot use this algorithm in a program. And i just canīt get the solution how to program it.

I would really appreciate, if someone can help me.


07-25-2002, 10:29 AM
Let A and B be the two points on your ray. Then RV=B-A is the ray vector and RO=A is the ray origin. PN is the plane normal and PD is the distance from the origin to your plane in PN units. If D=RV[dot]PN is zero there is no intersection else I=RO+RV*(RD-(RO[dot]PN))/D. I is your intersection point. Try this or visit www.realtimerendering.com (http://www.realtimerendering.com) !

08-01-2002, 07:43 PM
P1 and P2 are a point of ray.
Pa,Pb,Pc are points of plane.
Ax+By+Cz+D = plane equation...
A,B,C = normal of plane(try use cross product)
then u can get D from the equation of plane..
Try to put the p1 and p2 to a plane equation
and u will get a value (distance1 and distance2)....
no intersection