VertexTypes(3D) — Kubota Pacfic Computer Inc. (Doré)
NAME
VertexTypes − An explanation of Doré primitive vertex types
DESCRIPTION
The information in this manual page pertains to most Doré 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 Doré database, you may provide information about vertex normals, vertex colors, uv coordinates, and uvw coordinates. This additional information is used by Doré to more accurately shade the object during rendering.
When a Doré primitive object is created, all the vertex data (locations, normals, colors, 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 vertextypeVertex Information Supplied
DcLoc<DCL>Only the vertex location
DcLocNrm<DCLN>The vertex location and the vertex normal
DcLocClr<DCLC>The vertex location and the vertex color
DcLocNrmClr<DCLNC> All three are supplied
If DcLoc <DCL> is specified, three floating point values (x,y,z) must be supplied for each vertex. DcLocNrm <DCLN> and DcLocClr <DCLC> require three additional values for vertex normals and vertex colors, respectively. DcLocNrmClr <DCLNC> requires nine floating point values for each vertex. Note that these color counts assume a color model that requires three components per vertex, such as the RGB color model.
Vertex normals must be unit vectors (of length one). Normals that are not unit vectors will produce improper shading.
The Doré 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 Doré Programmer’s Guide.
March 13, 1992