G3*_Normal

C Specification


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

void G3_Normal(fx16 x, fx16 y, fx16 z);

// Below are APIs for creating the display list (command list)
void G3B_Normal(GXDLInfo* info, fx16 x, fx16 y, fx16 z);
void G3C_Normal(GXDLInfo* info, fx16 x, fx16 y, fx16 z);
void G3BS_Normal(GXDLInfo* info, fx16 x, fx16 y, fx16 z);
void G3CS_Normal(GXDLInfo* info, fx16 x, fx16 y, fx16 z);

Arguments

info Command List Information
x x-component of the normal vector
y y-component of the normal vector
z z-component of the normal vector

Return Values

None.

Description

This function sets the normal vector. The x, y, and z arguments can take values of more than or equal to -FX16_ONE and less than or equal to 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). Because vector normalization is not performed by the hardware, be sure to set a normalized vector.

The vertex color requested by the lighting is valid until the current vertex color is updated by the G3*_Color, G3*_Normal, or G3*_MaterialColorDiffAmb (vertex color set flag) command. For this reason, normal vectors can be shared by multiple vertices during actual use. Lighting only occurs when the Normal command is executed. Accordingly, to reflect the results in the vertex color caused by turning lighting ON or OFF or changing the material parameters, the Normal command must be executed again.

See Also

G3*_Color, G3*_MaterialColorDiffAmb

Revision History

01/19/2004 Initial version