Spot Lights

Started by
-1 comments, last by compiler 18 years, 3 months ago
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) ??

This topic is closed to new replies.

Advertisement