PDA

View Full Version : lighting question



crappy04
05-12-2000, 03:10 PM
hey i would like to make a light that resembles the sun but i want it stationary and always to shine in the exact same spot no matter where i i move the camera. the way i have it now everytime i change viewpoints the light shines in a different spot or if i dont use a spot light it rotates around the object im currently looking at. any ideas of how to stop this and make it point at the same place everytime? thanks

Bob
05-13-2000, 01:30 AM
Looks like you are setting your lightposition before you set your modelview matrix (cameraposition). Try set lightposition AFTER you set modelview matrix.

Not only vertices is multiplied by the current modelview matrix, but also the lightposition. If you set lightposition before cameraposition, the light will end up in the position you specify relative to the camera (<0,0,0> is where the camera is placed).

09-23-2002, 08:15 AM
THANK YOU, THANK YOU, THANK YOU !!!
YOU SOLVED A PROBLEM THAT WAS TURNING ME CRAZY FOR ONE WEEK!!