Jump to content
  • Advertisement
Sign in to follow this  
compiler

Spot Lights

This topic is 4608 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

hello, ive got a question about spotlights. as u might know theta is the (radian) angle of the spotlight's inner cone and phi is the (radian) angle of spotlight's outer cone: http://img483.imageshack.us/img483/8796/angle5vm.jpg L is a unit vector which represents the direction of the spot light and D is a unit vector which points to the vertex from the light source. alpha is the angle between the light direction L and D. if i want know if a vertex is OUTSIDE the light, then i have the following formula: alpha > Phi/2 where alpha = arccos(L*D) so i get: arccos(L*D) > Phi/2 now im using the cos for the whole formula to get the final formula to calculate if a vertex lies beyond the outer cone: L*D > cos(Phi/2) the problem is, that i found the following text in the d3d documentation: "If the dot product of vectors L and D is less than or equal to the cosine of the outer cone angle, the vertex lies beyond the outer cone and receives no light." this is exactly my formula excapt the fact that they use less-equal instead of my greater. can anybody tell my why it is L*D <= cos(phi/2) ??

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!