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

## gDPSetPrimDepth [macro]

Sets the primitive depth (Z) in the RDP.

Syntax

    #include <ultra64.h> /* gbi.h */
    gDPSetPrimDepth(Gfx *gdl, s32 z, s32 dz)
    gsDPSetPrimDepth(s32 z, s32 dz)

Arguments

- gdl is the display list pointer.

- z is the Z value (16-bit precision, s15).

- dz is the deltaZ value (16-bit precision, s15)

Explanation
Sets the Z value (as well as the deltaZ value) to be used for the entire primitive in the RDP. The Z format used in the blender (BL) is 15.3 fixed point. The primitive Z is a 16-bit register. So when the depth source is set to G_ZS_PRIMI (see g*DPSetDepthSource), the high-order bit is ignored, and the integer value corresponding to the Z value is given to the remaining 15 bits. When the primitive Z is being used, the bit for the fractional part is set to 0. The deltaZ format used in the BL is 16-bit. The primitive deltaZ uses all 16 bits. Note that for storage in the Z buffer, the Z value is converted to a 14-bit value, and the deltaZ value is converted to a 4-bit value. For details about using and storing Z values, see Section 12.7.6, "Depth Source" in the N64 Online Programming Manual.

See Also
gDPSetDepthSource
gDPSetPrimColor

Revision History
2/1/99 Completely rewritten.

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-1999
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last Updated April, 1999