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 2 of 2

Thread: point light source rotations

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2004
    Posts
    6

    point light source rotations

    I have a cube with a spotlight attatched to the bottom of it. The spotlight shines on anything thats directly below it.

    Problem is, this cube is mobile. When I translate or rotate the cube the light must stay with it. Now I know how to keep the light with the cube during a translation, but I'm not sure how to keep the light with the cube after a rotation (using glRotatef() )

    Is there a way to get the cube coordinates after a glRotate() is performed on it?
    Or better yet, is there a way to rotate a point light source using glRotate()?
    Thanks

  2. #2
    Junior Member Regular Contributor
    Join Date
    Jan 2004
    Location
    Los Angeles, CA, USA
    Posts
    216

    Re: point light source rotations

    I believe if you place the light when you draw the cube, that would do it. I could be wrong. If so, I'm sure the red book has a section in the lighting chapter about having lights move with objects.

Posting Permissions

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