View Full Version : lighting question
05-12-2000, 04: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
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).
THANK YOU, THANK YOU, THANK YOU !!!
YOU SOLVED A PROBLEM THAT WAS TURNING ME CRAZY FOR ONE WEEK!!
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.