VertexTypes(3D)

NAME
VertexTypes - An explanation of Dore primitive vertex types

DESCRIPTION
The information in this manual page pertains to most Dore primitive objects. Notable exceptions are variable data primitives (DoVar- <DOV-> functions), which use a different syntax to obtain vertex information, and DoPrimSurf <DOPMS> primitives, which do not allow user-defined vertex information.

When entering primitive object data into the Dore database, you may provide information about vertex normals, vertex colors, vertex alpha, uv coordinates, and uvw coordinates. This additional information is used by Dore to more accurately shade the object during rendering.

When a Dore primitive object is created, all the vertex data (locations, normals, colors, alpha, uv coordinates, and uvw coordinates) are specified in a single array. A base vertextype parameter must be set to reflect the type of information supplied for each vertex. (Note that these color counts assume a color model that requires three components per vertex, such as the RGB color model.) The following table lists the possible constant values for vertextype:

Value of vertextype	Vertex Information Supplied
DcLoc <DCL>               Only vertex location
DcLocNrm <DCLN>	      Location and normal
DcLocClr <DCLC>	      Location and color
DcLocNrmClr <DCLNC>	      Location, normal and color
DcLocAlpha <DCLA>	      Location and alpha
DcLocNrmAlpha <DCLNA>     Location, normal and alpha
DcLocClrAlpha <DCLCA>     Location, color and alpha
DcLocNrmClrAlpha <DCLNCA> Location, normal, color and alpha

Locations are specified as three floating point values (x,y,z) for each vertex. Normals and colors are also specified as three floating point values. Note that Dore assumes a color model that requires three components per vertex, such as the RGB color model. Alpha (or transparency) values are specified as one floating point value per vertex.

Vertex normals must be unit vectors (of length one). Normals that are not unit vectors will produce improper shading.

The Dore functions DsTextureUVCount <DSTUVC> and DsTextureUVWCount <DSTWC> can be used in conjunction with a base vertextype parameter to specify a new vertex type that includes uv and/or uvw coordinates. The new vertex type is specified by ORing one of the base vertex values with the above named functions. Both DsTextureUVCount <DSTUVC> and DsTextureUVWCount <DSTWC> take a parameter, count, which specifies how many sets of uv or uvw coordinates are specified for each vertex in the vertex list.

As an example, consider the following vertex type specification within a DoTriangleList <DOTRIL> function. In C:
DoTriangleList(DcRGB, DcLocClr | DsTextureUVCount(2), tri_cnt, vert)
FORTRAN:
DOTRIL (DCRGB, IOR (DCLC, DSTUVC(2)) TCNT, VERT)
In this function, the vertex type specifies that each vertex is defined by ten DtReal <REAL*8> values:
        an ordered triple specifying the vertex position
        an ordered triple specifying the red, green and blue values
        two ordered pairs specifying uv coordinates
If the value of tri_cnt in this example were fifteen, the array vert would contain 150 DtReal <REAL*8> values.

A vertex type may specify both uv and uvw coordinates. Associated vertex arrays would list uv data before uvw data.

Examples of various vertex arrays can be found in Chapter 4 of the Dore Programmer's Guide.