Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: is it possible??

  1. #1
    Guest

    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

  2. #2
    Junior Member Newbie
    Join Date
    Aug 2002
    Location
    norco, ca, 92860
    Posts
    6

    Re: is it possible??

    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.

  3. #3
    Member Regular Contributor
    Join Date
    Feb 2002
    Posts
    377

    Re: is it possible??

    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

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,797

    Re: is it possible??

    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.
    Deiussum
    Software Engineer and OpenGL enthusiast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •