Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Zoney

rotating light

This topic is 5543 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

I''ve managed to add a simple light to my heightmap but when I move around the camera i rotate the terrain around the camera so that it seems that the camera is rotating, only the light gets f****d up because it stays in the same position while the world is rotating. Should I rotate the light with the rest of the scene, and if so how?, or should I rotate the camera in some other way?

Share this post


Link to post
Share on other sites
Advertisement
Yeah man, rotate the light with the scene... Do something like this


glLoadIdentity();

glRotatef(//yaw);
glRotatef(//pitch);
glRotatef(//roll);
glTranslatef(//camera position);

//Setup Light
//Draw Landscape

-=|Mr.Oreo|=-
Code Monkey, Serpent Engine

Share this post


Link to post
Share on other sites
no, you should not rotate the light. Just use the ''POSITION'' (named something else) flag each frame.




-----------------------------
AM

Share this post


Link to post
Share on other sites

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