HP b2600 Reference Manual page 251

Opengl 1.1 reference
Hide thumbs Also See for b2600:
Table of Contents

Advertisement

L
glLight
Description
glLight sets the values of individual light source parameters. light names the light and is
a symbolic name of the form GL_LIGHTi, where 0
i < GL_MAX_LIGHTS. pname
specifies one of ten light source parameters, again by symbolic name. params is either a
single value or a pointer to an array that contains the new values.
To enable and disable lighting calculation, call glEnable and glDisable with argument
GL_LIGHTING. Lighting is initially disabled. When it is enabled, light sources that are
enabled contribute to the lighting calculation. Light source i is enabled and disabled
using glEnable and glDisable with argument GL_LIGHTi.
The ten light parameters are as follows:
GL_AMBIENT
params contains four integer or floating-point values that specify the ambient RGBA
intensity of the light. Integer values are mapped linearly such that the most positive
representable value maps to 1.0, and the most negative representable value maps to -
1.0. Floating-point values are mapped directly. Neither integer nor floating-point values
are clamped. The initial ambient light intensity is (0, 0, 0, 1).
GL_DIFFUSE
params contains four integer or floating-point values that specify the diffuse RGBA
intensity of the light. Integer values are mapped linearly such that the most positive
representable value maps to 1.0, and the most negative representable value maps to -
1.0. Floating-point values are mapped directly. Neither integer nor floating-point values
are clamped. The initial value for GL_LIGHT0 is (1, 1, 1, 1); for other lights, the initial
value is (0, 0, 0, 0).
GL_SPECULAR
params contains four integer or floating-point values that specify the specular RGBA
intensity of the light. Integer values are mapped linearly such that the most positive
representable value maps to 1.0, and the most negative representable value maps to -
1.0. Floating-point values are mapped directly. Neither integer nor floating-point values
are clamped. The initial value for GL_LIGHT0 is (1, 1, 1, 1); for other lights, the initial
value is (0, 0, 0, 0).
GL_POSITION
params contains four integer or floating-point values that specify the position of the light
in homogeneous object coordinates. Both integer and floating-point values are mapped
directly. Neither integer nor floating-point values are clamped.
The position is transformed by the modelview matrix when glLight is called (just as if it
were a point), and it is stored in eye coordinates. If the w component of the position is 0,
the light is treated as a directional source. Diffuse and specular lighting calculations
take the light's direction, but not its actual position, into account, and attenuation is
disabled. Otherwise, diffuse and specular lighting calculations are based on the actual
location of the light in eye coordinates, and attenuation is enabled. The initial position is
(0, 0, 1, 0); thus, the initial light source is directional, parallel to, and in the direction of
the Z axis.
GL_SPOT_DIRECTION
params contains three integer or floating-point values that specify the direction of the
light in homogeneous object coordinates. Both integer and floating-point values are
mapped directly. Neither integer nor floating-point values are clamped. The spot
251
Chapter 10

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents