Jump to content
  • Advertisement
Sign in to follow this  
NickyP101

Simple Graphics/Maths Q

This topic is 4820 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!