rotating light
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?
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
glLoadIdentity();
glRotatef(//yaw);
glRotatef(//pitch);
glRotatef(//roll);
glTranslatef(//camera position);
//Setup Light
//Draw Landscape
-=|Mr.Oreo|=-
Code Monkey, Serpent Engine
no, you should not rotate the light. Just use the ''POSITION'' (named something else) flag each frame.
-----------------------------
AM
-----------------------------
AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement