• Advertisement

Archived

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

rotating light

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