Dominik
07-28-2001, 08:36 AM
I got a problem with lighting - i wanna move the light around the z axis. I got the translation and in the VC++ Debugger everything looks ok - then i update the position by calling glLight* and nothing happens the light anyway comes from the original direction and location.
i got the light at X: 450, Y 750 and z -750 and the rotation is okay, but no result is seen.
do i have to disable lighting to move it ? or is it the 0.0f in the last param ??
i enclose my draw function part..
// rotate the light along the z axis
GLfloat lightx = -450.0f;
GLfloat lighty = -750.0f;
GLfloat lightz = 750.0f;
LightPosition[0] = (lightx*cos(clock*PII))-(lighty*sin(clock*PII));
LightPosition[1] = (lightx*sin(clock*PII))+(lighty*cos(clock*PII));
LightPosition[2] = lightz;
LightPosition[3] = 0.0f;
glLightfv(GL_LIGHT1, GL_POSITION, LightPosition);
thanks for help.
i got the light at X: 450, Y 750 and z -750 and the rotation is okay, but no result is seen.
do i have to disable lighting to move it ? or is it the 0.0f in the last param ??
i enclose my draw function part..
// rotate the light along the z axis
GLfloat lightx = -450.0f;
GLfloat lighty = -750.0f;
GLfloat lightz = 750.0f;
LightPosition[0] = (lightx*cos(clock*PII))-(lighty*sin(clock*PII));
LightPosition[1] = (lightx*sin(clock*PII))+(lighty*cos(clock*PII));
LightPosition[2] = lightz;
LightPosition[3] = 0.0f;
glLightfv(GL_LIGHT1, GL_POSITION, LightPosition);
thanks for help.