rotating light

Started by
1 comment, last by Zoney 20 years, 8 months ago
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?
"If there was no god, it would be necessary to invent one" - Voltaire
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
-=|Mr.Oreo|=-Code Monkey, Serpent Engine
no, you should not rotate the light. Just use the ''POSITION'' (named something else) flag each frame.




-----------------------------
AM
-----------------------------Amma

This topic is closed to new replies.

Advertisement