Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

MisterOreo

Point on a plane

This topic is 5611 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I''m trying to project a point (a light actually) onto a plane defined by the 3 verticies of a triangle. Basically I need to move the point along the normal of the plane, some distance t, so that it lies on the plane. I''m reading NeHe''s tutorial on it now (http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=30), and he comes out with this value for t as t= (Xn dot (PointOnRay - Raystart)) / (Xn dot Raydirection) Now.. the RayDirection in this case, is just the normal, and a point on that ray, could be the light it''s self... and the ray start... well... could also be the light... but.. even if I didn''t chose the light, PointOnRay - Raystart will give you the RayDirection.. which is the normal!! Is there something I''m missing here? How can I project my point onto a the nearest point on a plane? -Mr.Oreo

Share this post


Link to post
Share on other sites
Advertisement
I''m not thinking clearly today, but I think that is a ray/plane intersection, not the nearest point on the plane. The nearest point on the plane is p-((p-pip).n)*n where p is the point, n is a unit normal for the plane and pip is a point in the plane. (p-pip).n=p.n-pip.n. pip.n is the distance of the plane from the origin in multiples of n and is the same for every point in the plane. p.n is the distance from the origin to a plane containing p which is parallel to the original plane. The distance between the planes is the differance in their distances from the origin. It is a directed distance meaning it can be positive or negative with positive being the same direction as n and negative being in the -n direction. (p-pip).n is the directed distance from the plane containing pip to the parallel plane containing p. ((p-pip).n)*n is a vector from the plane containing pip to the parallel plane containing p. So if you subtract it you have a vector from the parallel plane containing p to the plane containing pip.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!