Original Post
Hi
i got a really weird problem with OpenGL lightning:
at the beginning of my prog i init a light this way:
GLfloat Light[] = { 1.0f, 1.0f, 1.0f, 1.0f };
GLfloat LightPosition[] = { 0.0f, 0.0f, 50.0f, 0.0f };
glLightfv ( GL_LIGHT0, GL_SPECULAR, Light );
glLightfv ( GL_LIGHT0, GL_DIFFUSE, Light );
glLightfv ( GL_LIGHT0, GL_AMBIENT, Light );
glLightfv ( GL_LIGHT0, GL_POSITION, LightPosition );
glEnable ( GL_LIGHT0 );
glEnable ( GL_LIGHTING );
in the rendering loop i call then glRotatef for the x, y and z angles and glTranslatef with the negative position vector of my camera and then i draw my terrain as a grid of verts on the x-z plane and y as the height, from x/z -10/-10 to +10/+10 or something like that, so that the (0,0,0)-coord is in the middle of my terrain
this works all the way it should, BUT the stoopid light won''t work =(
In my opinion the way i do it it should just enlighten my terrain uniformly, with the lightsource 50 units above the middle of my terrain...but what i get is this:
when i look in the -z direction it looks bright the way i want it, but when i turn to look in +z direction it turns completely dark
it does this no matter on what point of the map the camera is
and i have no idea how to get it so that the whole terrain, no matter in what direction i look, is equally lit
If anyone has an idea how to solve this problem please tell me..this stuff is driving me crazy =)
Thanks for your help,
BurningIce