#include <revolution/gx.h>
void GXInitLightPos(
GXLightObj* lt_obj,
f32 x,
f32 y,
f32 z );
| lt_obj | Pointer to a light object. |
|---|---|
| x | X coordinate of the position. |
| y | Y coordinate of the position. |
| z | Z coordinate of the position. |
None.
This function sets the position of the light in the light object. The Wii graphics hardware supports local diffuse lights. The position of the light should be in the same space as a transformed vertex position (i.e., view space).
Although the hardware does not support parallel directional diffuse lights, it is possible to approximate parallel lights by setting sufficiently large values to position parameters (x, y, z), which makes the light position very far away from objects to be lit and all rays considered almost parallel. You can specify such position parameters within the valid value range, which is roughly -1.0E+19 < x, y, z < 1.0E+19. Values that exceed this range may cause overflow in the lighting hardware that can lead to unexpected results.
The memory for the light object must be allocated by the application; this function does not load any hardware registers directly. To load a light object into a hardware light, use the GXLoadLightObjImm or GXLoadLightObjIndx functions.
GXInitLightDir, GXLoadLightObjImm, GXLoadLightObjIndx, GXSetChanCtrl, GXGetLightPos, GXLightObj Initialization Flow
2006/03/01 Initial version.
CONFIDENTIAL