.\" @(#)PEXGeoNormQuadrilateralMesh.3 1.5 95/03/24 SMI; .so man3/pex.macs .TH PEXGeoNormQuadrilateralMesh 3 "May 1995" "Solaris PEXlib Reference Manual" "" .SH NAME PEXGeoNormQuadrilateralMesh - utility function .SH SYNTAX .HP int PEXGeoNormQuadrilateralMesh\^(\^unsigned int \fIfacet_attributes\fP, unsigned int \fIvertex_attributes\fP, int \fIcolor_type\fP, PEXArrayOfFacetData \fIfacet_data\fP, unsigned int \fIcol_count\fP, unsigned int \fIrow_count\fP, PEXArrayOfVertex \fIvertices\fP) .SH PARAMETERS .IP \fIfacet_attributes\fP 1i A mask indicating the facet attributes provided. It should contain the bit .B PEXGANormal. .IP \fIvertex_attributes\fP 1i A mask indicating the vertex attributes provided. .IP \fIcolor_type\fP 1i The type of color data provided. .IP \fIfacet_data\fP 1i An array of facet data. This function adds the geometric normal to this data. .IP \fIcol_count\fP 1i The number of columns in the vertex array. .IP \fIrow_count\fP 1i The number of rows in the vertex array. .IP \fIvertices\fP 1i A two-dimensional (row-major) array of vertices defining the quadrilateral mesh. .SH RETURNS Zero if successful; otherwise, one of the following: .TP .B PEXBadPrimitive A normal cannot be computed for one or more quadrilaterals in the mesh. .SH DESCRIPTION .\" indexing .IX PEXGeoNormQuadrilateralMesh .IX "Utility Functions" PEXGeoNormQuadrilateralMesh .LP This function computes the geometric normals of a quadrilateral mesh and stores them in the specified facet data. .LP The geometric normal of each quadrilateral is computed by forming two vectors from two of its sides, and computing the cross product of those two vectors. The geometric normal is the normalized cross product: .LP .RS Ng = (V1 x V2) / |V1 X V2| .RE .LP Given the quadrilateral composed of four vertices, Pi,j, where i indicates the row of the point and j its column, the first vector, V1, is from Pi,j to Pi+1,j+1. The second vector, V2, is from Pi+1,j to Pi,j+1. .LP If the facet attributes does not contain the bit .B PEXGANormal, the geometric normal is not computed. However, the function still returns successfully. .LP A geometric normal is computed for all quadrilaterals where it is possible to compute one, even if a normal cannot be computed for some other quadrilaterals. An error is returned if a normal cannot be computed for one or more of the quadrilaterals in the mesh. .SH ERRORS None