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: Simple Question

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2009
    Posts
    2

    Simple Question

    Hi im new to opengl and i followed a tutorial to make a cube rotate with the mouse. The thing is that i added a point light and i wanted to rotate the light but in the inverse direction of the cube so that it is always lighting the front face. I rotate the cube with this:

    glRotatef( g_fRot[0], 1.0f, 0.0f, 0.0f );
    glRotatef( g_fRot[1], 0.0f, 1.0f, 0.0f );
    glRotatef( g_fRot[2], 0.0f, 0.0f, 1.0f );

    And i have my light position with a vector g_fLight[]

    I really dont know how to do it

  2. #2
    Junior Member Regular Contributor
    Join Date
    Dec 2008
    Location
    USA
    Posts
    135

    Re: Simple Question

    If you set the position of the light at the beginning when you initialize everything, it should stay put.

Posting Permissions

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