glLight
glLight refers to a set of OpenGL functions used in the fixed-function lighting model to specify parameters for individual light sources. The core functions are glLightf, glLighti, glLightfv, and glLightiv. Each function takes a light identifier, such as GL_LIGHT0 through GL_LIGHT7, a pname indicating what property to set, and a value or array to assign. Typical properties include GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_POSITION for spatial attributes, and GL_SPOT_DIRECTION, GL_SPOT_CUTOFF, GL_SPOT_EXPONENT for spotlights, as well as attenuation factors GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, GL_QUADRATIC_ATTENUATION.
The position parameter is a four-component vector (x, y, z, w). If w is 0, the light
To use glLight, lighting must be enabled with glEnable(GL_LIGHTING), and individual light sources must be enabled
Common usage involves configuring ambient/diffuse/specular properties, setting a light’s position, optionally enabling a spotlight, and selecting