PDA

View Full Version : is it possible??



12-18-2002, 07:12 AM
hi
Is it possible to move the light along with viewpoint(camera position)?
Will it be ok if i update the light settings just before gluLookAt() statement?

Thanks

zeroKelvin
12-18-2002, 10:07 AM
the light and the lookAt function do different things to the setting and are not related to each other. if you do update the light before the lookAt function it does not have any effects on the lookAt function. Even if it did you won't see the difference since on average the displays are updated with a minimal of 30 times per second. As for moving the LookAt function along an axis. You will need the keyboard function, and also declare a global variable or two because I don't know the details of which of the 6 to 8 (i think) arguements you need alter in the lookAt functions. Once you have made a keyboard function make the case statement to a character so that when you push those characters then the program ether increments or decrements the variable. Hope this helps.

satan
12-18-2002, 02:29 PM
Originally posted by pl:
hi
Is it possible to move the light along with viewpoint(camera position)?
Will it be ok if i update the light settings just before gluLookAt() statement?

Thanks

yes
no, do it just after gluLookAt

Deiussum
12-19-2002, 05:30 AM
Kevin is right that the light function doesn't have any effect on the look at function, but the look at function DOES have an effect on the light function. The position you pass glLight is affected by the current modelview matrix, and since you should be using gluLookAt to modify the modelview matrix, it DOES matter what order you call them.