is it possible??

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

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.

Originally posted by pl:
[b]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[/b]

yes
no, do it just after gluLookAt

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.