rjDrawLineList3D - shaddatic/sa2b-render-fix GitHub Wiki
Prototype
void rjDrawLineList3D( const NJS_POINT3* vtx, Sint32 Count, Float r, Uint32 Color )
API
void (*DrawLineList3D)( const NJS_POINT3* vtx, Sint32 Count, Float r, Uint32 Color )
Ninja
N/A
Parameters
const NJS_POINT3* vtx
Line vertex list
Int Count
Line count
Float r
Line width in hardware units
Int Color
Line color. Translucent drawing is used if Alpha component is != 0xFF
Returns
No return value.
Description
Draw 'n' line list vertexes in 3D units.
Example
This example will draw a 64x64, opaque, box out of 4 red lines in the center of the world at Y +10. The box will be formed around the Y axis. The lines will have a width of 2 pixels. This example's comments assumes the camera is looking down the -Z axis.
#define NUM_LINE 4
#define NUM_VTX NUM_LINE * 2
// set vertex list
NJS_POINT3 vtx[NUM_VTX] =
{
// x, y, z
{ -32.f, 0.f, -32.f }, // line 1: far left
{ -32.f, 0.f, 32.f }, // line 1: near left
{ -32.f, 0.f, 32.f }, // line 2: near left
{ 32.f, 0.f. -32.f }, // line 2: near right
{ 32.f, 0.f. -32.f }, // line 3: near right
{ 32.f, 0.f, 32.f }, // line 3: far right
{ 32.f, 0.f, 32.f }, // line 4: far right
{ -32.f, 0.f, -32.f }, // line 4: far left, again
};
// begin matrix
njPushMatrix( NULL );
// offset lines 1 meter upwards in world space
njTranslate( NULL, 0.f, 10.f, 0.f );
// draw lines
rjDrawLineList3D( vtx, NUM_VTX, 2.f, 0xFFFF0000 ); // <<<<<<<<
// end matrix
njPopMatrix( 1 );
Related Functions
- rjDrawLineStrip3D() Draw a 3D line strip