cptpingu
Messages postés
3837
Date d'inscription
dimanche 12 décembre 2004
Statut
Modérateur
Dernière intervention
28 mars 2023
123
8 juin 2006 à 14:38
C'est tiré de mon propre code, donc tu devras adapter:
Initialisation
glLightfv( GL_LIGHT2, GL_AMBIENT, @CheckPoints_Ambiente );
glLightfv( GL_LIGHT2, GL_DIFFUSE, @CheckPoints_Diffuse );
glLightfv( GL_LIGHT2, GL_SPECULAR, @CheckPoints_Speculaire );
glLightf ( GL_LIGHT2, GL_SPOT_CUTOFF, 40 );
glLightf ( GL_LIGHT2, GL_SPOT_EXPONENT, 10 );
glLightfv( GL_LIGHT2, GL_SPOT_DIRECTION, @Direction_En_Bas );
Utilisation
{------------------------------------------------------------------}
{ Affiche un spot au-dessus du prochain checkPoints }
{------------------------------------------------------------------}
procedure AfficherSpotCheckPoints(XLum,YLum,ZLum:glFLoat);
begin
glPushMatrix();
glLoadIdentity;
glRotate(Tilt, 1, 0, 0);
glRotate(Heading, 0, 1, 0);
glTranslatef(X, Y, Z);
CheckSpot_Position[0]:=XLum;
CheckSpot_Position[1]:=YLum;
CheckSpot_Position[2]:=-Longueur-1+ZLum;
glLightfv( GL_LIGHT2, GL_POSITION, @CheckSpot_Position );
glLightfv( GL_LIGHT2, GL_SPOT_DIRECTION, @Direction_En_Bas );
glEnable ( GL_LIGHT2);
glPopMatrix();
end;