int PEXOCCGeoNormPolyTriangle( PEXOCC context, PEXPointer occ_facet_data, unsigned int count, PEXPointer occ_vertex_data, int handedness )
Zero if successful; otherwise, one of the following:
Invoke PEXOCCGeoNormPolyTriangle to compute the geometric normals of each of the triangles in a PolyTriangle and store them in the specified facet data.
The geometric normal of each triangle 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:
Ng = (V1 x V2) / |V1 x V2|
See the description in PEXOCCPolyTriangle to determine how the vectors V1 and V2 are determined.
Specify the handedness argument to generate normals that match the orientation of the coordinate system that the vertex data uses. PEXVertexOrderRightHand indicates that the coordinate system is right-handed, and PEXVertexOrderLeftHand indicates that the normals are to be "flipped" from the right-handed orientation to match a left-handed coordinate system.
If the facet attributes does not contain the bit PEXGANormal, then this utility does not compute the geometric normal. However, this utility still returns successfully.
A geometric normal is computed for all triangles where it is possible to compute one, even if a normal cannot be computed for some other triangles. An error is returned if a normal cannot be computed for one or more of the triangles in the list.
None.
For a list of utilities that compute geometric normals, see Computing Geometric Normals. For a list of related topics, see PEXlib Utilities.