1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
GLfloat ambient_spots[] = { 0.0 , 0.0 , 0.0 , 1.0 };
GLfloat diffuse_spots[] = { 0.60 , 0.60 , 0.60 , 1.0 };
GLfloat specular_spots[] = { 0.0 , 0.0 , 0.0 , 1.0 };
GLfloat direction_spots[] = { 1.0 , 0.0 , 0.0 , 0.0 };
GLfloat position_spots[] = { 2.0 , 1.5 , 6.0 , 0.0 };
glLightfv(GL_LIGHT2, GL_AMBIENT, ambient_spots);
glLightfv(GL_LIGHT2, GL_DIFFUSE, diffuse_spots);
glLightfv(GL_LIGHT2, GL_SPECULAR, specular_spots);
glLightfv(GL_LIGHT2, GL_POSITION, position_spots);
glLightf(GL_LIGHT2, GL_SPOT_CUTOFF, 5.0); // éclaire d'un angle de 5
glLightfv(GL_LIGHT2, GL_SPOT_DIRECTION, direction_spots);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT2); |
Partager