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