### Spotlight Demo

The demo shows a white square illuminated by a rather dim white viewpoint light and three bright spotlights. The spotlights are red, green, and blue. In the default view, they are located above the front face of the square, and they are pointed in the direction of a point located below the center of the square, so that the centers of the three spots are at the vertices of a triangle on the square. The spotlights are fixed with respect to the square. You can drag on the square to rotate it, and the spotlights rotate with the square. Note that the square is shiny, and both the viewpoint light and the spotlights produce specular highlights.

The checkboxes allow you to turn off the viewpoint light and to turn off specular reflection, so you can see the effect of the spotlights better. If you turn off "Spotlights Rotate with Square" option, then the spotlights are fixed with respect to the viewer instead of with respect to the square, and the spots that they make on the square change shape as the square is rotated. The animation changes the position and direction of the spotlights.

The sliders control the cutoff angle and the spot exponent for the spotlights. If you set the spot exponent to zero, the spotlight will illuminate the points in the light cone evenly (though the illumination can look different at different points because the light hits the points at different angles). If the spot exponent is large, then only small cutoff angles will have an effect, because the light dims to almost zero even at fairly small angles. For an interesting effect, try running the animation with a large cutoff angle and a very small spot exponent.