Makes a material, light, or lighting model definition active.
FORTRAN (libfgl.a)
void lmbind(Int16 target, Int32 index)
SUBROUTINE LMBIND(target, index) INTEGER*4 target, index
Note: For FORTRAN users, this subroutine accepts long integer parameters (INTEGER*4) when invoked from a FORTRAN program, although it accepts short integers when invoked from a C program. The C and FORTRAN syntax shown here reflect this difference.
The lmbind subroutine takes a previously defined material, light, or lighting model and makes it active. Up to eight lights can be active (turned on) at the same time, but only one lighting model or material can be turned on at any time. Therefore, binding a material or lighting model automatically unbinds (deactivates) the previous lighting model or material.
The definition of a light, lighting model, or material (created previously with the lmdef subroutine) is not destroyed when one of these is unbound. The definition remains and can be rebound at a later time.
Notes:
- Some of the properties of the currently bound material can be changed on the fly with the lmcolor subroutine, which provides a highly efficient path for temporarily changing material properties. Using the lmcolor subroutine is much more efficient than employing a combination of the lmdef and lmbind subroutines.
- Lighting cannot be turned on and does not work if the matrix mode is not set to MVIEWING. The matrix mode can be changed with the mmode subroutine.
- The operation of this subroutine for the Supergraphics Processor Subsystem is modified. (See "Hardware Considerations" in GL3.2 Version 4 for AIX: Programming Concepts.)
index | Specifies the index into the table of previously defined materials, lights, or lighting models. Created with the lmdef subroutine. | |||||||||||||||
target | Specifies the target of the bind. There are 10 valid constants tokens that can be used for this parameter:
|
The example C language program cylinder2.c uses the lmbind subroutine to use the materials, lights, and lighting model defined with the lmdef subroutine.
This subroutine is part of GL in the AIXwindows Environment/6000 Version 1, Release 2 with AIXwindows/3D Feature.
Materials with different material properties on each side are now supported on the Gt4 class of graphics adapters and the GXT1000. Support for two-sided lighting is accomplished with the following token:
If two-sided lighting is enabled, and BACKMATERIAL is bound to a non-zero index, then the BACKMATERIAL properties are used for back-facing polygons, and MATERIAL properties are used for front-facing polygons. If two-sided lighting is enabled, and a zero index is bound to BACKMATERIAL, then the MATERIAL properties are used for both sides. If two-sided lighting is disabled, the material bound to BACKMATERIAL is not used.
Two-sided lighting applies only to polygons and triangles; it does not apply to points, lines and characters, where only the MATERIAL properties are used.
Note: If a light does not appear to be in the correct location, be sure that the current matrix had an appropriate value when the light was bound. The light position is transformed by the current matrix when the light is bound.
/usr/include/gl/gl.h | Contains C language constant and variable type definitions for GL. |
/usr/include/gl/fgl.h | Contains FORTRAN constant and variable type definitions for GL. |
Specifying RGBA colors with a single packed 32-bit integer using the cpack subroutine.
Changing the target of the color commands with the lmcolor subroutine.
Making a new material, light source, or lighting model active with the lmdef subroutine.
Setting the current matrix mode with the mmode subroutine.
Specifying a normal vector with the n3f subroutine.
Updating the current normal vector with the normal subroutine.
Setting the current color in RGB mode with the RGBcolor subroutine.
AIX Graphics Library Overview, Creating Lighting Effects, and Setting Pipeline Options.