Stationary (directional) light? How?

Hi…again :wink:

I have been trying to get a directional light to stay in the same position no matter where I place the camera, without any luck.

We have this 3D engine we are porting to use a driver based system and - essentially - it requires us to force OpenGL into at the moment - so, currently no matrix stacks - and the way things are done are kind of based on D3D :frowning:

If I place a directional C3DLight - that’s out class - in the scene and rotate the camera around a box, the light always lights the front of the box in OpenGL, in D3D it doesn’t.

I’ve tried changing the model matrix - glLoadIdentity() followed by inverse of camera matrix - and many other solutions I thought I’d found on this board, but so far, nothing seems to work.

Any ideas from the knowledgable people here?

Thanks,
Luke A. Guest.

check the faq http://www.frii.com/~martz/oglfaq/lights.htm

set your light position after you have set the camera position (so you have to do this every frame).