I don’t think I understand the opengl-light-model correctly.

[ul][li] How can I set the radius of the light[*] How can I set the stuph to light up[/ul][/li]I’ve got the basics working however, somehow I cant figure out the above. The normals get calculated like :

float Ax, Ay, Az;

float Bx, By, Bz;

float Cx, Cy, Cz;

float l;

for(long i=0;iLevelWidth;i++)

for(long j=0;jLevelHeight;j++)

{

Ax = x1;

Ay = y1;

Az = z1;

Bx = x2 - x1;

By = y2 - y1;

Bz = z2 - z1;

Cx=AyBz - ByAz;

Cy=AzBx - BzAx;

Cz=AxBy - BxAy;

l = (float)sqrt(CxCx + CyCy + Cz*Cz);

this->Normals[i+j*this->LevelWidth].x += Cx / l;

this->Normals[i+j*this->LevelWidth].y += Cy / l;

this->Normals[i+j*this->LevelWidth].z += Cy / l;

}

Help – Divide

[This message has been edited by Divide Overflow (edited 11-22-2000).]