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

   

gSPLineW3D
gSPLine3D

Format
#include "gbi.h"

gSPLine3D(Gfx *gdl,
   int v0, int v1,
   int flag)
gsSPLine3D(int v0,
   int v1, int flag)

gSPLineW3D(Gfx *gdl,
   int v0, int v1,
   int wd, int flag)
gsSPLineW3D(int v0,
   int v1, int wd,
   int flag)
Arguments
  • gdl is the pointer to the graphics display list
  • v0, v1 specify the vertex cache indices
  • wd is the line width in half-pixel units
  • flag is the line flat-shading index
What These Macros Do
It generates one line, using the vertices v0, v1 in the internal vertex buffer loaded by the gSPVertex macro.

The wd argument of the gSPLineW3D macro is the width in half-pixel units. It ranges from 0 to 255. This width is added to 1.5 to generate the final line width. The minimum line thickness of 0 maps to 1.5, 1 maps to 2.0, 2 maps to 2.5, and so on.

The flag should be either 0 or 1 to identify which of the two vertices should be used as the color for the line (for flat shading).

These macros work only if the line microcode is loaded.

Note
When the line microcode is loaded, the gSPTriangle1 macro does not work correctly, it is interpreted as a do-nothing macro (no-op). Likewise, parts of the geometry state, gSPSetGeometryMode
are not useful (G_CULL_FRONT, G_CULL_BACK, and G_CULL_BOTH).

Only a few of the RDP render modes are valid for lines. The most commonly used ones would be RM_AA_XLU_LINE or RM_AA_ZB_XLU_LINE. Consult the gbi.h file for more line-related render modes.

When you use RM_AA_ZB_XLU_LINE, the Z-Buffer is read but not written into, so lines should be drawn after polygons to enable proper Z-Buffering to occur. Lines do not self-occlude.

The line microcode modifies the RDP scissoring coordinates, so they must be reset to desired values by subsequent display lists.

Because the lines are rendered as trapezoids, "end cap" problems are visible when drawing thick lines.

See Also
gSPVertex



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