PDA

View Full Version : Light position



MaHoHo
10-21-2004, 10:32 PM
I think I have a real blackout now.

In the Gerbera sample app I changed the light to always shine onto the cube from the same direction relative to the cube. i.e. always the same spot of the cube is lighted. So far so easy.

What I don't get to work is to get the light stationary relative to the view! i.e. let it always shine onto the cube from the direction of the camera. Initializing the light at the beginning with negative Z doesn't help, neither does putting it before the translation/rotation inside MODELVIEW modification.

Any suggestions where to put a "headlight" would be appreciated.