Sign in to follow this  
NickyP101

Simple Graphics/Maths Q

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this