• Advertisement
Sign in to follow this  

Simple Graphics/Maths Q

This topic is 4639 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, as i found out i need to rotate my light source as i rotate my world. Im currently using glulookat to do the rotating for me. To put it simply im really struggling, i know how to get the angle of xRotation from the player to the camera. But i dont know how to rotate the point of the light source using this information. Any tutorials or tips would be greatly appreciated, Cheers, Nick :)

Share this post


Link to post
Share on other sites
Advertisement
I suppose you want to use directional lighting, and always light it using the direction you're viewing the scene with?
Grab it from the view-matrix. In D3D this is the 3rd column, so i guess it's the 3rd row in GL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement