al - Audio Library Functions gDP - DP GBI Macros gdSP - General GBI Macros gSP - SP GBI Macros gt - Turbo Microcode RDP gu - Graphics Utilities Math - Math Functions nuSys - NuSystem os - N64 Operating System sp - Sprite Library Functions uh - Host to Target IO 64DD - N64 Disk Drive
|
gSPInsertMatrixFormat#include "gbi.h" gSPInsertMatrix(Gfx *gdl, unsigned int where, unsigned int num) gsSPInsertMatrix(unsigned int where, unsigned int num)Arguments
This is an advanced macro. You need to have a good understanding of how matrices work in the RSP microcode before you use this macro (see gSPMatrix). This macro replaces two elements of the concatenated MODELVIEW and PROJECTION matrix with two new numbers (supplied in the num parameter). Due to the internal format of the RSP's Matrices (see gSPMatrix), elements of the matrix can only be modified in pairs. It is important to understand that the matrix being modified is the concatenated MODELVIEW and PROJECTION matrix, and that no matrix multiplication is performed after the gSPInsertMatrix macro. No matrix pushes or pops are performed, and the top of the MODELVIEW and PROJECTION matrix stacks are untouched. If this macro is followed by a gSPMatrix macro, the matrix elements modified by gSPInsertMatrix will be lost and will not affect the new matrix on the RSP; it will be as if the gSPInsertMatrix macro had never been sent. The replaced elements are specified by the where argument. To modify an element completely, you must modify both the integer and fractional part of the matrix. See the note on Matrix Format in the gSPMatrix page for more information. Values for the where argument are:
The gSPInsertMatrix macro does not affect lighting. Therefore, if you are using lighting and you use the gSPInsertMatrix macro, the lights will act on a rendered object according to the RSP's matrix state preceding the gSPInsertMatrix macro, but the object's position and orientation will be affected by the changes to the matrix made by the gSPInsertMatrix macro. Matrix Format Please see the note on Matrix Format in the gSPMatrix page. Example To modify the x and y translate terms of a matrix to be 20.5 and 15.25 (respectively), use this code: gSPInsertMatrix(glistp++, G_MWO_MATRIX_WX_WY_I, 0x0014000f); gSPInsertMatrix(glistp++, G_MWO_MATRIX_WX_WY_F, 0x80004000);See Also gSPMatrix gSPForceMatrix
|