DoVarQuadGrid(3D)

NAME
DoVarQuadGrid - Create a variable quadrilateral grid primitive object

SYNOPSIS
C:
DtObject DoVarQuadGrid(colormodel, width, height, vertlocs,
		vertnorms, vertcolors, smoothflag)
DtColorModel colormodel;
DtInt width, height;
DtReal vertlocs[];
DtReal vertnorms[];
DtReal vertcolors[];
DtFlag smoothflag;

FORTRAN:
INTEGER*4 DOVQDG(COLMOD, WIDTH, HEIGHT, VTXLOC,
		VTXNRM, VTXCLR, SMOOFL)
INTEGER*4 COLMOD
INTEGER*4 WIDTH, HEIGHT
REAL*8 VTXLOC(*)
REAL*8 VTXNRM(*)
REAL*8 VTXCLR(*)
INTEGER*4 SMOOFL

DESCRIPTION
DoVarQuadGrid creates a primitive object that defines a variable grid of (width-1) by (height-1) quadrilaterals.

The main difference between a variable quadrilateral grid and a quadrilateral grid is that the variable primitive does not make a copy of the vertex data into its own data space. It simply maintains pointers to the vertex data (locations, normals and colors) in user space. A call to DpUpdVarQuadGrid <DPUVQG>, informs a variable quadrilateral grid object that the user data has changed.

The parameter colormodel specifies the color model used if vertex colors are provided. The parameter vertlocs is an array of vertex locations. Vertex data must be provided for width*height vertices. Starting from the upper left corner, the first width vertices specify the top edges of the grid. Each subsequent group of width vertices specifies the next row of vertices for the grid. The parameter vertnorms is an array of vertex normals. If vertex normals are not available use DcNullPtr <DCNULL>. The parameter vertcolors is an array of vertex colors. If vertex colors are not available use DcNullPtr <DCNULL>.

If vertex normals are not provided, the parameter smoothflag specifies that the vertex normal for shading purposes will be the average of the geometric normals from a vertex's adjacent surfaces. This assumes that the quadrilateral grid defines a smooth surface.

The geometric normal to each quadrilateral is calculated using the right-hand rule (when the fingers of the right hand point in the order of the vertices, the thumb points in the direction of the normal). These normals are sometimes used for backface culling of facet shading.

For texture mapping, uv and uvw vertex information is added and modified using DpUpdVarQuadGridUV and DpUpdVarQuadGridUVW.

ERRORS
DoVarQuadGrid will issue a warning if a zero vertex normal is calculated by Dore.

[WARNING - quad normals sum to 0 at vertex, check for back to back triangles]

SEE ALSO
DpUpdVarQuadGrid(3D), DoQuadGrid(3D), DpUpdVarQuadGridUV(3D), DpUpdVarQuadGridUVW(3D), DoQuadMesh(3D), DoQuadList(3D)