/* Demo exhibiting the use of a spotlight */ #include #include #include #include //allows user to change number of squares int num = 4; //variables for spotlight GLfloat xVal = 5; GLfloat yVal = 3; GLfloat zVal = 5; GLfloat light[4]={xVal,yVal,zVal,1}; /*spotlight location*/ GLfloat outline = true ; GLfloat lightCutoff = 35; GLfloat smooth = true; GLfloat base; /* ===================================================================== 1*1 unit square drawn with triangle_strips. In practice, we would probably just use twDrawUnitSquare(), but this allows us to draw the triangles if we choose. */ void drawUnitSquare(int w, int h ) { int i,j; GLfloat dw = 1.0/w; GLfloat dh = 1.0/h; glNormal3f(0,1,0); for( i=0; i