GXLoadPosMtxIndx

C Specification

#include <revolution/gx.h>
void GXLoadPosMtxIndx(
    u16     mtxIndx, 
    u32     id );

Arguments

mtxIndx Specifies the index to the matrix data in the main memory.
id Specifies the matrix name. Can specify a value enumerated by GXPosNrmMtx.

Return Values

None.

Description

This function loads the 3x4 matrix model view matrix indicated by the index mtxIndx from the array in main memory set by the function described next into the matrix memory location id.

GXSetArray(GX_POS_MTX_ARRAY, ...);

The allowed id memory location is described by the GXPosNrmMtx enumeration. This modelview matrix is used to transform positions in model space to view space, either by making the matrix the current one (see GXSetCurrentMtx), or by setting a matrix id for each vertex (see GXSetVtxDesc). The matrix will be loaded through the vertex cache.

You can also load a normal matrix (GXLoadNrmMtxImm or GXLoadNrmMtxIndx3x3) to the same id. Usually the normal matrix will be the inverse transpose of the modelview matrix. The normal matrix is used for vertex lighting. In cases where the inverse transpose of the modelview and the modelview matrix are the same (excluding translation), you can load the same matrix for both the normal and the position matrix. Since indexed matrix loads are through the vertex cache, you will only incur the main memory bandwidth of one matrix load. 

Note: The matrix is loaded directly from main memory into the matrix memory through the vertex cache, so it is incoherent with the CPU's cache. It's the application's responsibility to flush any matrix data from the CPU cache (see DCStoreRange) before calling this function.

See Also

GXSetCurrentMtx
GXLoadNrmMtxImm
GXLoadNrmMtxIndx3x3
GXLoadPosMtxImm

Revision History

2006/03/01 Initial version.


CONFIDENTIAL