GXInitLightDir

Syntax

#include <revolution/gx.h>

void GXInitLightDir(
    GXLightObj* lt_obj,
    f32         nx,
    f32         ny,
    f32         nz );

Arguments

lt_obj Pointer to a light object.
nx X coordinate for the light direction.
ny Y coordinate for the light direction.
nz Z coordinate for the light direction

Return Values

None.

Description

This function sets the direction of light in the light object. This direction is used when the light object is used as spotlight (see the attn_fn argument of the GXSetChanCtrl function). The memory for the light object must be allocated by the application; this function does not load any hardware registers. To load a light object into a hardware light, use the GXLoadLightObjImm or GXLoadLightObjIndx function.

The coordinate space of the light direction should be consistent with a vertex normal transformed by a normal matrix; i.e., it should be transformed to view space. The direction vector is required to be normalized.

Note: This function can't specify the direction of parallel directional diffuse lights. To use parallel diffuse lights, place the light position very far from all objects to be lit. (See the GXInitLightPos and GXSetChanCtrl functions.)

See Also

GXInitLightPos, GXLoadLightObjImm, GXLoadLightObjIndx, GXSetChanCtrl, GXGetLightDir, GXLightObj Initialization Flow

Revision History

2006/03/01 Initial version.


CONFIDENTIAL