Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any quick way to find the intersection point between Plane and Ray?

share|improve this question
Try googling "line plane intersection" – brandon Feb 1 '12 at 14:27
An intersection between a Vector3 and a Plane doesn't make sense. You can find the intersection between a Plane and a line segment, a ray, or a line, but all of these require not one, but two Vector3's to be represented. Or you can check if a certain Point lies on the Plane or not. Which of these are you trying to achieve? – David Gouveia Feb 1 '12 at 14:30
i am using the Vector3 as a Direction , Mmm it should be a Ray not a Vector3 – MhdSyrwan Feb 1 '12 at 14:38
long story short, study linear algebra – brandon Feb 1 '12 at 14:51
up vote 5 down vote accepted

Try the following method which relies on XNA's built in Math API to intersect a Ray and a Plane and get back the point of intersection:

Vector3? GetRayPlaneIntersectionPoint(Ray ray, Plane plane)
    float? distance = ray.Intersects(plane);
    return distance.HasValue ? ray.Position + ray.Direction * distance.Value : null;

The method returns null if there's no intersection, or the point of intersection otherwise.

share|improve this answer
thanks very much :) , i thought it returns just a boolean – MhdSyrwan Feb 1 '12 at 15:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.