lmbind(3G) lmbind(3G)
NAME
lmbind - binds a new material, light, or lighting model
definition
SPECIFICATION
C
lmbind(target, index)
short target, index;
FORTRAN
subroutine lmbind(target, index)
integer*4 target, index
DESCRIPTION
lmbind binds a material, light, or lighting model
definition to the current material, one of eight current
lights, or the current lighting model. target is either
MATERIAL, LIGHT0, LIGHT1, LIGHT2, ..., LIGHT7, or LMODEL.
index is an index into the table of previously defined
materials, lights, or lighting models. If index is not
defined, the system uses index 0.
While a definition is bound, a change to the definition has
immediate effect. To unbind a definition, bind a different
definition to target. A light can be bound only once, i.e.,
it cannot be bound to more than one light target. The
exception is light 0 which can be bound any number of times.
Light positions are transformed by the current model/view
matrix when lmbind is called. The original position is
maintained so that subsequent bindings transform the
original position.
To compute a new color for drawing, lighting calculations
use the currently bound material, lights, and lighting
model, as well as the current transformed normal and
graphics position. Lighting models use only material and
light properties that are appropriate for their
calculations. The system ignores other properties but
stores them for future use if a different lighting model is
bound. Rebinding the lighting model is the least efficient;
rebinding a material is the most efficient.
SEE ALSO
lmdef, normal, color, RGBcolor
Programming Guide, Section 14.4
NOTE
This routine is available in immediate mode and can be
called within graphic objects.
Page 1 (printed 8/20/87)