Lights

Getting a bit frustrated now, I’d be very grateful for some help.
My light changes at the strangest occasions. If I use cout << lightposition it becomes clear that the light is at the same position every loop. Could it be the position that changes BETWEEN start and end of loop, or does it have to be the objects that moves?

Thanks in advance

Um, I’m not sure what you mean. Can you be a bit more specific. Whats the problem? Are there objects that are not lighted at certain times, or is there no light at certain times?

The thing is, I do the following:
glMatrixMode (MODELVIEW)
LoadIdentity();
gluLookAt
glLightfv(GL_LIGHT1, GL_POSITION, myposarray);
glPushMatrix();
move and draw objects
glPopMatrix();
and so on…
this continues with push-draw-pop for all different objects.
If some objects NOT are drawn, the lighting is incorrect, but if one object is placed in the scene or one object in the scene is swapped to another one (are you with me? )
then the lighting gets correct…

things are improving…it had something to do with the 4th parameter directional/positional light.
Now, the objects dont move or whatever they did, BUT before one object has been “laid down” on the grid that i have, (it’s kind of an editor), the gridcolor is gray…after one object is laid down, the color gets white…

At last the problem was solved.
The grid was drawn using GL_LINES, which don’t have any normals. That made the light on the lines depend on the last drawn polygons normals.