View Full Version : The direction vector in directional lights.

03-25-2001, 11:13 PM

The problem is very simple to explain:

The direction vector of directional light doesn't have an effect in software. It works great in full hardware acceleration mode, but in software, even if I insert a direction vector of ( 0,0,0 ) it doesn't have an effect and act like its a static lights illuminate down the Z axis.

Have an idea ????

Thanx, Itzik.

[This message has been edited by Almony (edited 03-26-2001).]

[This message has been edited by Almony (edited 03-26-2001).]

03-26-2001, 08:09 AM
Are you using coordinates for a true directional light? To create a directional light you do something like so.

float dir[] = {0.0, 0.0, 1.0, 0.0};

glLightfv(GL_LIGHT0, GL_POSITION, dir);

If you were to use 1.0 as the last float value in the array, this will create a positional light at 0,0,1. Using 0 makes it directional with a vector of 0,0,1.

[This message has been edited by Deiussum (edited 03-26-2001).]

03-26-2001, 10:00 PM
This is true, and this is exactly what I'm doing, but yet the problem is something about the rendering with or without hardware acceleration.

any help please ???