#include <revolution/gx.h>
void GXInitLightPos(
GXLightObj* lt_obj,
f32 x,
f32 y,
f32 z );
lt_obj |
Pointer to a light object. |
x |
returns the X coordinate of position. |
y |
returns the Y coordinate of position. |
z |
returns the Z coordinate of position. |
None.
This function sets the position of the light in the light object. The Revolution 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 doesn't support parallel directional diffuse lights, it is possible to get "almost parallel" lights by setting sufficient large values to position parameters (x, y, and 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 parameter in the valid value range which is roughly defined as: -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 GXLoadLightObjImm or GXLoadLightObjIndx.
GXInitLightDir
GXLoadLightObjImm
GXLoadLightObjIndx
GXSetChanCtrl
GXGetLightPos
GXLightObj Initialization Flow
2006/03/01 Initial version.
CONFIDENTIAL