-
calculate angle between camera and light
Hi all,
I’m trying to do the following:
I have a camera and a light in a scene. I’ve added a lensflare (Knoll Light Factory) to the light (converting 3D position data to 2D coordinates).
Now I want to link the brightness of the flare to the angle of the light in relationship to the position of the camera:
If the light points into the camera the flare should be 100. And when the light turns away from the camera the brightness should fade to zero.
I think it should work something like this: if the camera is on or close to the ‘line of sight’ of the light, the outcoming value should be 100. And if there’s a bigger angle between the ‘line of sight’ of the light, the outcoming value should decrease.
But my combination of math and scripting skills prevent me from cracking this. Anyone?
Thanks in advance for any help.
Bar3nd