N64® Functions Menu

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

Nintendo® Confidential

   

gSPZViewPort

Format
gSPZViewPort(Gfx *gp, Vp *vp)
Arguments
  • gp is the pointer to the graphics display list
  • vp is the pointer to viewport data
What This Macro Does
This Z-Sort microcode GBI macro is roughly the same as the gSPViewPort GBI macro in F3DEX microcode. Although it sets the viewport, there are differences in the viewport data parameters. In Z-Sort microcode, the parameter to control Fog is specified to the Vp structure member variables vscale, vscale[3] of vtrans and vtrans[3] using this macro:
vp->vp.scale[3] = GZ_VIEWPORT_FOG_S(in, out);
vp->vp.trans[3] = GZ_VIEWPORT_FOG_T(in, out);
  • in is the Fog start distance
  • out is the Fog end distance
A negative value must be set for the vscale[1] value to make the top part of the screen positive, that is, the right, top, front direction (in the clockwise system).

Start Fog from a distance of 3000 from the perspective. When specifying so that the background color is uniform at a distance of 4000, initialize as follows:
Vp  viewport = {
     SCREEN_WD*2, *SCREEN_HT*2, G_MAXZ/2, GZ_VIEWPORT_FOG_S (3000, 4000)
     SCREEN_WD*2, *SCREEN_HT*2, G_MAXZ/2, GZ_VIEWPORT_FOG_S (3000, 4000)
} ;
For detailed information on Z-Sort microcode's GBI macros and data structures, please see the "Z-Sort Microcode" area of the N64 Programming Manual.

See Also
Z-Sort Microcode
gSPZRdpCmd
gSPZSetUMem
gSPZGetUMem
gSPZSetMtx
gSPZGetMtx
gSPZMtxCat
gSPZMtxTrnsp3x3
gSPZViewPort
gSPZMultMPMtx
gSPZSetAmbient
gSPZSetDefuse
gSPZSetLookAt
gSPZXfmLights
gSPZLight
gSPZLightMaterial
gSPZMixS16
gSPZMixS8
gSPZMixU8
gSPZSegment
gSPZSetSubDL
gSPZLinkSubDL
gSPZSendMessage
gSPZWaitSignal
gSPZSegment
gSPZPerspNormalize



Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.


Copyright © 1998
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated January 1998