Updates elements of the matrix (without performing multiplication)
#include <ultra64.h> /* gbi.h */ gSPInsertMatrix(Gfx *gdl, u32 where, u32 num) gsSPInsertMatrix( u32 where, u32 num)
This macro substitutes new values for two elements of the matrix used for vertex transformations (This matrix is the concatenated matrix of the model view and projection matrix). The internal format of the RSP matrix elements are modified in pairs. Please note that this matrix is the modified matrix of the model view matrix and projection matrix, and after this macro there is no matrix multiplication. Also, there is no matrix pushing or popping on the model view and projection matrix stacks, and the tops of the stacks are not modified. If gSPMatrix follows this macro, the matrix supplied by this macro will be destroyed, and it will have no effect on the RSP's new matrix (i.e., the result is the same as if this macro had not been used).
The elements that are to be replaced are specified by where. To completely modify the elements, both the integer part and fractional part of the matrix must be modified. For details, see gSPMatrix.
Since this is an advanced macro, before using it, you should have a good understanding of how matrices are used in the RSP microcode. For details, see gSPMatrix and Section 11.3, "Matrix State" in the N64 Online Programming Manual.
This macro does not affect lighting. Therefore, if this macro is used when light is being used, the object will be rendered in accordance with the light of the RSP matrix state prior to this macro. The object's position and orientation, however, will be determined by the matrix resulting from this macro.
For information related to the matrix format, see gSPMatrix.
This macro is not supported by F3DEX2.
The following instructions modify the x and y transformation terms of the matrix to 20.5 and 15.25, respectively:
gSPInsertMatrix(glistp++, G_MWO_MATRIX_WX_WY_I, 0x0014000f); gSPInsertMatrix(glistp++, G_MWO_MATRIX_WX_WY_F, 0x80004000);
02/01/99 Entirely revised.