G3*_LightVector

C Specification


#include <nitro/gx/g3imm.h>
#include <nitro/gx/g3b.h>
#include <nitro/gx/g3c.h>

void G3_LightVector(GXLightId lightID, fx16 x, fx16 y, fx16 z);

// Below are APIs for creating the display list (command list)
void G3B_LightVector(GXDLInfo* info, GXLightId lightID, fx16 x, fx16 y, fx16 z);
void G3C_LightVector(GXDLInfo* info, GXLightId lightID, fx16 x, fx16 y, fx16 z);
void G3BS_LightVector(GXDLInfo* info, GXLightId lightID, fx16 x, fx16 y, fx16 z);
void G3CS_LightVector(GXDLInfo* info, GXLightId lightID, fx16 x, fx16 y, fx16 z);

Arguments

info Command List Information
lightID Light number (0 - 3)
x x-component of the light directional vector
y y-component of the light directional vector
z z-component of the light directional vector

Return Values

None.

Description

This function sets the direction vector for light. lightID selects one of 4 lights, and x, y, and z set the light vector. The arguments can take values of more than -FX16_ONE and less than FX16_ONE - 1. Because the format is changed internally to fixed point decimal (sign + 9-bit decimal), the value is passed to the hardware as more than -1.0 (0xF000) and less than 0.998 (0x0FF9). Set a unit vector because the hardware does not normalize vectors. See G3*_LightColor for details on GXLightId types.
Note:  Immediately after the settings, coordinate conversion occurs internally according to the current directional vector matrix. In other words, this function is called for both cases when the light direction changes and when the camera direction changes.

See Also

G3*_LightColor

Revision History

02/09/2004

01/19/2004 Initial version