DoPatch(3D)

NAME
DoPatch - Create a patch primitive object

SYNOPSIS
C:
DtObject DoPatch(colormodel, vertextype, matrixl,
	vertices, matrixr)
DtColorModel colormodel;
DtVertexType vertices;
DtObject matrixl;
DtObject matrixr;
DtReal vertices[];

FORTRAN:
INTEGER*4 DOPAT(COLMOD, VTXTYP, MATRXL,
	VTXS, MATRXR)
INTEGER*4 COLMOD
INTEGER*4 VTXTYP
INTEGER*4 MATRXL
INTEGER*4 MATRXR
REAL*8 VTXS(*)

DESCRIPTION
DoPatch creates a patch primitive object. The patch type is determined by the pair of matrices used. These matrices could be DcBezier4 <DCMXB4>, DcHermite4 <DCMXH4>, or DcBSpline4 <DCMXBS>. The user may specify a non-standard matrix object with DoMatrix <DOM>.

The parameter colormodel specifies the color model if the control points specify color for shading purposes. The parameter vertextype specifies the nature of the control points; only types DcLoc <DCL> and DcLocClr <DCLC> are allowed. for more information, refer to Chapter 6, in the r to the VertexTypes on-line manual page.)

The patch is defined by the list of control points in the parameter vertices. The area for the patch control points in control space is always 0.0 to 1.0 in each direction.

By allowing different matrices to be specified for both the left (matrixl) and right (matrixr) matrices, both the size and type of parameterization in each direction can be individually controlled. If the same matrix type is specified for both matrices, then the entire patch will be of that type; the right matrix is internally transposed before use. The order is determined by the dimension of each matrix, i.e, the number of vertices in that direction. The degree will always be one less than this number. FORTRAN array element FOO(j+1,i+1).

The use of the matrices follows this equation:

               2  3
P(u,v) = [1 u u  u  ... ] * matrixl * vertices *
                            T         2  3      T
                     matrixr  * [1 v v  v  ... ]

If this primitive object defines a closed surface or will be oriented with backfacing parts of the surface away from the viewer, then backface culling may speed up the rendering time. See DoBackfaceCullable and DoBackfaceCullSwitch.

ERRORS
DoPatch will fail if the vertex type is not DcLoc or DcLocClr.

[WARNING - bad vertex type]

DoPatch will fail if an invalid matrix object is specified.

[WARNING - invalid matrix object handle]

DoPatch will fail if a non-square matrix is specified.

[WARNING - non square matrix]

SEE ALSO
DoBackfaceCullSwitch(3D), DoBackfaceCullable(3D), DoNURBSurf(3D), VertexTypes(3D)