## 5.9 Lighting

Lighting is controled by three items: light sources, light model and material properties. The color of a vertex is calculated based on the following factors: (a) the position of the vertex, the current normal vector and the current material properties. (b) the position and properties of the light sources and (c) the light model properties.

For a complete description of lighting calculations, please see

      AUTHOR: Neider, Jackie
      TITLE: OpenGL programming guide : the official guide to learning
            OpenGL, release 1 /OpenGL Architecture Review Board, Jackie
                             Neider, Tom Davis, Mason Woo.
      PUBLISHED:      Reading, Mass. : Addison-Wesley, c1993.
      DESCRIPTION:    xxxiii, 516 p., (16) p. of plates : ill. (some col.) ; 24 cm.
      NOTES:          Includes index.
      SUBJECTS:       OpenGL
                      Computer graphics
      OTHER AUTHORS:  Davis, Tom
                      Woo, Mason
                      OpenGL Architecture Review Board
      ISBN:           0201632748
      OCLC NUMBER:    27679041

To use lighting, follow the following steps.

- Call `EZ_Enable(EZ_LIGHTING)` to enable lighting calculations.

- Call `EZ_Enable(EZ_LIGHT#)` to turn on light sources, where `#` is an integer between 0 and 7. One can turn on multiple light sources.

- Call `EZ_Lightfv`, `EZ_LightModelfv` and `EZ_Materialfv` to set light source properties, light model properties and material properties.

- When define a geometric object, make sure you set the normal vectors by using `EZ_Normal3fv`. If needed, one may enable color material and use `EZ_Color3fv` to set vertex colors.

HTML Documentation Maintainance:`Arturo Espinosa <arturo@nuclecu.unam.mx>`