Advertisement Jump to content
Sign in to follow this  

Spot Lights

This topic is 4765 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: 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
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!