Hi all..
Ok. Here's my problem:
I'm doing sort of a game whice includes space flight, asteroids, starships, space station etc... Anyway, I'm got my asteroids and my camera (pseudo code soon to come) and I'm trying to add a directional light but it rotates according to the asteroids which is quite annoying...What I want is to have the light at a fixed direction and the rest - rotating (btw: the camera can also move...).
so here's the code (of the drawing routine);
glLoadIdentity();
glRotate(camera rotation (x,y,z));
glTranslate(-camera position);
glLightfv(LightPosition) //which is 1,0,0,0
for(i=0 i<number_of_asteroids i++)
{
glPushMaterix();
glTranslate(asteroid position);
glRotate(asteroid rotation (x,y,z));
DrawAsteroid();
glPopMatrix();
}
thanks in advance
Shahar.