# 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.

## 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) ??

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 9
• 13
• 9
• 9
• 15
• ### Forum Statistics

• Total Topics
634076
• Total Posts
3015350
×