gSPLine3D

gSPLine3D [Macro]

Function

gSPLine3D

Generates one line

Syntax

#include <ultra64.h>        /* gbi.h */
gSPLine3D(Gfx *gdl, s32 v0, s32 v1, s32 flag)
gsSPLine3D(         s32 v0, s32 v1, s32 flag)

Arguments

gdl
the display list pointer.
v0, v1
the vertex buffer indices (0~31).
flag
the line flat-shading index (0~1):
0 (Draws line using the v0 color.)
1 (Draws line using the v1 color.)

Description

This macro generates one line with a width of 1.5 pixels using the vertices v0, v1 loaded in the vertex buffer by the gSPVertex macro. To specify the line width, use gSPLineW3D. For details, please see Section 11.9.2, "Lines" in the N64 Programming Manual. This macro works only when line microcode (L3DEX, L3DEX2) is loaded.

Note

When line microcode is loaded, the gSP1Triangle macro is interpreted as NOOP and not processed. Also, some geometry states cannot be used (i.e., the geometry pipeline modes G_CULL_FRONT, G_CULL_BACK and G_CULL_BOTH in gSPSetGeometryMode). (F3DLX2.Rej, however, does support G_CULL_FRONT and G_CULL_BOTH). Only a few of the RDP's render modes are valid for drawing lines. The most typical modes used are RM_AA_XLU_LINE and RM_AA_ZB_XLU_LINE (see g*DPSetRenderMode). When you use RM_AA_ZB_XLU_LINE, the Z-Buffer can be read but it cannot be written to. For this reason, lines must be drawn after Z-buffered polygons. For details, please see Section 15.7.3, "Transparent Lines, XLU_LINE" in the N64 Programming Manual. To learn more about the rendering modes, see g*DPSetRenderMode and <gbi.h>.

Since the line microcode changes the RDP scissoring coordinates (see g*DPSetScissor), the drawing area (the scissoring box) must be reset for the next display list. The exception is with the F3DEX2 microcode, where drawing can be performed without resetting the scissoring box.

See Also

gSPLineW3D, gSPVertex

Revision History

02/01/99 Entirely revised.