rjDrawTexture3DHEx - shaddatic/sa2b-render-fix GitHub Wiki
Prototype
void rjDrawTexture3DHEx( const NJS_TEXTUREH_VTX* polygon, Int count, Int flag )
API
void (*DrawTexture3DHEx)( const NJS_TEXTUREH_VTX* polygon, Int count, Int flag )
Ninja
void njDrawTexture3DHEx( NJS_TEXTUREH_VTX* polygon, Int count, Int flag )
Parameters
const NJS_TEXTUREH_VTX* polygon
polygon vertex list, of length count
Int count
Length of vertex list
Int trans
Use translucency (TRUE/FALSE)
Returns
No return value.
Description
Draw a textured polygon with 'n' vertexes in 3D units with a highlight color.
The vertex list is in triangle strip format.
Example
This example will draw a 64x64, opaque, multi-colored polygon in the center of the world at Y +10. It uses a texture index of 0 in a defined texlist, and has a white highlight color on its right edge. This example's comments assumes the camera is looking down the -Z axis.
#define NUM_VTX 4
#define NUM_TEX 0
// set vertex list
NJS_TEXTUREH_VTX poly[NUM_VTX] =
{
// x, y, z, u, v, col (ARGB), off (XRGB)
[0] = { -32.f, 0.f, -32.f, 0.f, 0,f, 0xFFFFFFFF, 0xFF000000 }, // far left, white
[1] = { -32.f, 0.f, 32.f, 0.f, 1,f, 0xFFFF0000, 0xFF000000 }, // near left, red
[2] = { 32.f, 0.f, -32.f, 1.f, 0,f, 0xFF00FF00, 0xFFFFFFFF }, // far right, green
[3] = { 32.f, 0.f, 32.f, 1.f, 1,f, 0xFF0000FF, 0xFFFFFFFF }, // near right, blue
};
njPushMatrix( NULL );
// move polygon 1 meter upwards in world space
njTranslate( NULL, 0.f, 10.f, 0.f );
// set the texture
rjSetTexture( &texlist );
rjSetTextureNum( NUM_TEX );
// draw polygon
rjDrawTexture3DHEx( poly, NUM_VTX, FALSE ); // <<<<<<<<
njPopMatrix( 1 );
Related Functions
- rjSetTexture() Set the current texlist
- rjSetTextureNum() Set the current texture number in the current texlist
- rjDrawTextureH() Draw a textured polygon with highlight color
- rjDrawTextureHEx() Draw a textured polygon with highlight color
History
- 1.5.0.0: Introduced