|
|
|
|
|
|
|||||||||||||||||||||||||||||||||||
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
|
![]() |
gSPModifyVertex [macro]Modifies a vertex after it has been loaded in the RSP. Syntax
Arguments
Explanation
This macro is effective for use on a vertex that is shared by two or more triangles but has different properties depending on the triangle. For example, consider a vertex that is shared by two adjacent triangles, one of which is smooth-shaded from red to yellow, and the other which is smooth-shaded from green to cyan. In this case, you would first use gSPVertex to draw a triangle in which the vertex that is shared by both triangles is red and the other two vertices are yellow. Next, you could use this macro to change the color of the shared vertex to green for drawing the second triangle. The main use of this macro is to modify the texture coordinate of the shared vertex used by the first texture so it can be used by the second texture. Notes
Since lighting is not performed after this macro is run, modifying the vertex color with G_MWO_POINT_RGBA actually modifies the output color, and not the normal value. The s, t coordinates specified by this macro are not scaled by the texture scale value set by gSPTexture. These coordinates must be pre-scaled before they are transferred. For example, to use 1/2 (0x8000) as the texture scale, use a value that is one half of the value used by gSPVertex. Cautions
Example
/* Load vertices with gSPVertex */ gSPVertex(...); /* Load texture of triangle 1 */ gDPLoadTextureBlock(...); /* Draw triangle 1 using vertex #3 */ gSP1Triangle(glistp++, 1, 2, 3, 0); /* Change the value of vertex #3 to S=3.10 and T=2.5 */ gSPModifyVertex(glistp++, 3, G_MWO_POINT_ST, 0x00600050); /* Load the texture of triangle 2 */ gDPLoadTextureBlock(...); /* Draw triangle 2 using vertex #3 */ gSP1Triangle(glistp++, 1, 2, 3, 0); See Also
Revision History
|
|||||||||||||||||||||||||||||||||||||