View Full Version : Stationary (directional) light? How?

10-09-2000, 11:38 AM
Hi...again ;-)

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 :-(

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?

Luke A. Guest.

10-09-2000, 12:41 PM
check the faq http://www.frii.com/~martz/oglfaq/lights.htm

Don't Disturb
10-10-2000, 03:15 AM
set your light position after you have set the camera position (so you have to do this every frame).