оСВЕЩЕНИЕ
пример кода:
glEnable (GL_DEPTH_TEST);
glEnable (GL_COLOR_MATERIAL);
pos[0]:=0;pos[1]:=0;pos[2]:=3;pos[3]:=1;
pos1[0]:=0;pos1[1]:=0;pos1[2]:=3;pos1[3]:=1;
direct[0]:=0;direct[1]:=0;direct[2]:=-3;direct[3]:=1;
direct1[0]:=1;direct1[1]:=0;direct1[2]:=-3;direct1[3]:=1;
glViewport(0, 0, ClientWidth, ClientHeight);
glMatrixMode (GL_PROJECTION);
glLoadIdentity;
glFrustum (-2, 2, -2, 2, 1, 5);
gltranslate(0,0,-3);
glMatrixMode(GL_MODELVIEW);
glloadidentity;
glenable(gl_lighting);
glenable(gl_light0);
glenable(gl_light1);
gllightfv(gl_light0,gl_position,@pos);
gllightfv(gl_light0,GL_SPOT_DIRECTION,@direct);
gllightf(gl_light0,GL_SPOT_EXPONENT,50);
gllightf(gl_light0,GL_SPOT_CUTOFF,20);
gllightfv(gl_light1,gl_position,@pos1);
gllightfv(gl_light1,GL_SPOT_DIRECTION,@direct1);
gllightf(gl_light1,GL_SPOT_EXPONENT,50);
gllightf(gl_light1,GL_SPOT_CUTOFF,20);