Sign in to follow this  

spot light cone - plane intersection

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: (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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this