#include <revolution/gx.h>
void GXInitLightDir(
GXLightObj* lt_obj,
f32 nx,
f32 ny,
f32 nz );
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 |
None.
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 parameter of GXSetChanCtrl). 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 GXLoadLightObjImm or GXLoadLightObjIndx.
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. If you want parallel diffuse lights, you may put the light position very far from every objects to be lit. (See GXInitLightPos, GXSetChanCtrl also.)
GXInitLightPos
GXLoadLightObjImm
GXLoadLightObjIndx
GXSetChanCtrl
GXGetLightDir
GXLightObj Initialization Flow
03/01/2006 Initial version.