bgntmesh(3G) bgntmesh(3G)
bgntmesh, endtmesh - delimit the vertices of a triangle mesh
void bgntmesh()
void endtmesh()
none
Vertices specified between bgntmesh and endtmesh are used to define a
mesh of triangles. The graphics pipe maintains two vertex registers.
The first and second vertices are loaded into the registers, but no
triangle is drawn until the system executes the third vertex routine.
Upon executing the third vertex routine, the system draws a triangle
through the vertices, then replaces the older of the register vertices
with the third vertex.
For each new vertex routine, the system draws a triangle through the new
vertex and the stored vertices, then (by default) replaces the older
stored vertex with the new vertex. If you want the system to replace the
more recent of the stored vertices, call swaptmesh prior to calling v.
Between bgntmesh and endtmesh you can issue the following Graphics
Library routines: c, color, cpack, lmbind, lmcolor, lmdef, n, RGBcolor,
swaptmesh, t, and v. Use lmdef and lmbind only to respecify materials
and their properties.
If you want to use backface, you should specify the vertices of the first
triangle in counter-clockwise order. All triangles in the mesh have the
same rotation as the first triangle in a mesh so that backfacing works
correctly.
There is no limit to the number of vertices that can be specified between
bgntmesh and endtmesh.
By default triangle vertices are forced to the nearest pixel center prior
to scan conversion. Triangle accuracy is improved when this coercion is
defeated with the subpixel command. Subpixel vertex positioning is
especially important when triangles are scan converted with antialiasing
enabled (see polysmooth).
After endtmesh, the current graphics position is undefined.
For example, the code sequence:
Page 1
bgntmesh(3G) bgntmesh(3G)
bgntmesh();
v3f(v0);
v3f(v1);
v3f(v2);
v3f(v3);
endtmesh();
draws two triangles, (v0,v1,v2) and (v3,v2,v1), while the code sequence:
bgntmesh();
v3f(v0);
v3f(v1);
swaptmesh();
v3f(v2);
v3f(v3);
endtmesh();
draws two triangles, (v0,v1,v2) and (v0,v2,v3). There is no limit to the
number of times that swaptmesh can be called.
On Impact and Infinite Reality lmcolor cannot be called between bgntmesh
and endtmesh
backface, c, concave, frontface, polymode, polysmooth, scrsubdivide,
defpattern, shademodel, subpixel, swaptmesh, v
PPPPaaaaggggeeee 2222 [ Back ]
|