[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
GL3.2 Version 4.1 for AIX: Programming Concepts

Formula for Lighting Calculation

Lighting is calculated by the use of the following formula:

The symbols are as follows:

How r, l, v and p Are Computed

The unit view vector (v) is given by the following equation:

The unit light vector (l) is given by the following equation:

The reflection vector (r) is given by the following equation:

The attenuation factor (p) is given by the following equation:

The attenuation factor is then clipped to a value from 0.0 to 1.0.

The symbols are as follows:


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]