Jump to content
  • Advertisement
Sign in to follow this  
Hybrid666

spot light cone - plane intersection

This topic is 3631 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, Im trying to detect intersection between a cone of light and a plane. I think I'm almost there.. but am stuck at the last bit! Firstly, I do trivial rejection by performing a sphere test against the plane using cone centre and cone height to make the sphere. Secondly, I try to detect if the cone intersects the plane by working from the following diagram: http://img121.imagevenue.com/img.php?image=84152_cone_intersection_122_463lo.JPG (this is from a Dave Eberly book) I calculate d x (n x d) as: // inverted cone axis tVector4f InvertedAxis; InvertedAxis.Invert(c_rCone.GetAxis()); // perpedicular unit vector from cone along plane tVector4f w; w.CrossProduct(vNormal, InvertedAxis); w.Normalise(w); w.CrossProduct(InvertedAxis, w); w.Normalise(w); Then Theta (the top Theta in the diagram) (cos(Theta) = n . w) as: // angle from plane to cone const float32 c_fNdW = vNormal.DotProduct(w); const float32 c_fAngle = Math::Acos(c_fNdW); But at this point I get confused... The book now says: "If the intersection of the plane P and the axis of the cone is within the cone (i.e., the signed distance less than or equal to zero), then there is obviously an intersection. Otherwise, if Theta is less than or equal to α, then there is an intersection." I've also calculated I(a) in the diagram, by intersecting the cone axis with the plane, and know that I need this.. but am not sure how to apply it to solve the intersection test... Can anyone help? Thanks in advance, Hybrid [Edited by - Hybrid666 on August 14, 2008 3:11:21 PM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!