GXLoadNrmMtxImm

C Specification

#include <revolution/gx.h>
void GXLoadNrmMtxImm(
const f32   mtxPtr[3][4],
u32         id );

Arguments

mtxPtr Specifies a pointer to the matrix data
id Specifies the matrix name Can specify a value enumerated in GXPosNrmMtx

Return Values

None

Description

This function is used to load a 3x3 normal transform matrix into matrix memory at location id from the 3x4 matrix mtxPtr. This matrix is used to transform normals in model space to view space, either by making it the current matrix (see GXSetCurrentMtx), or by setting a matrix id for each vertex. The translation terms in the 3x4 matrix are not needed for normal rotation and are ignored during the load. The argument id enumerated in GXPosNrmMtx points to the load destination matrix location in the matrix memory.

You can also load a position coordinate matrix (GXLoadPosMtxImm) to the same id. Usually, the normal matrix will be the inverse transpose of the position (modelview) matrix and is used during vertex lighting. In cases where the modelview and the inverse transpose of the modelview matrix (excluding translation) are the same, the same matrix can be loaded for both normal and position matrices.

To load a normal matrix from a 3x3 matrix, use GXLoadNrmMtxImm3x3.

The matrix data is copied from main memory or the CPU cache into the graphics FIFO,  so matrices loaded using this function are always coherent with the CPU cache.

See Also

GXSetCurrentMtx
GXLoadPosMtxImm

Revision History

03/01/2006 Initial version.