14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

456 Three-Dimensional Scenes Chapter 13<br />

Lighting and Normals<br />

Figure 13.16 Spotlight<br />

SPOT_CUTOFF<br />

Light<br />

Source<br />

In addition to the cutoff angle, you can control the intensity and direction of the light distribution in the<br />

cone. SPOT_DIRECTION specifies the direction for the spotlight to point; SPOT_EXPONENT influences how<br />

concentrated the light is.<br />

Lighting Models<br />

Lighting models are specified with the Light Model command.<br />

Light Model( parameter, value,...,value )<br />

Light models specify three attributes of lights.<br />

• The global ambient light intensity<br />

• Whether the viewpoint is local or is an infinite distance away<br />

• Whether lighting calculations should be performed differently for the front and back faces of objects.<br />

Table 13.3 on page 454 shows the three valid parameters for the Light Model command.<br />

Table 13.4 Light Model Parameters and Default Values<br />

Parameter Default Value Meaning<br />

LIGHT_MODEL_AMBIENT (0.2, 0.2, 0.2, 1) Ambient RGBA intensity of the entire scene<br />

LIGHT_MODEL_LOCAL_VIEWER 0 (false) how specular reflection angles are computed<br />

LIGHT_MODEL_TWO_SIDE 0 (false) nonzero values imply two-sided lighting<br />

Normal Vectors<br />

Normal vectors point in a direction perpendicular to a surface. For a plane, all normals are the same. For a<br />

more complicated surface, normals are more complicated. JSL enables you to specify the normal vector for<br />

each vertex. These normals specify the orientation of the surface in space, necessary for lighting calculations.<br />

Accurate normals assure accurate lighting.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!