NAME

cxGeoNormalAdd - add normals to a geometry object
#include <cx/Geometry.h>

enum cxGeoBindingLevel { CX_GEO_PER_DEFAULT, CX_GEO_PER_OBJECT, CX_GEO_PER_PART, CX_GEO_PER_FACE, CX_GEO_PER_FACE_INDEXED, CX_GEO_PER_VERTEX, CX_GEO_PER_VERTEX_INDEXED };
void cxGeoNormalAdd( int n, float *normal, cxGeoBindingLevel per )
integer CX_GEO_PER_DEFAULT
integer CX_GEO_PER_OBJECT
integer CX_GEO_PER_PART
integer CX_GEO_PER_FACE
integer CX_GEO_PER_FACE_INDEXED
integer CX_GEO_PER_VERTEX
integer CX_GEO_PER_VERTEX_INDEXED

parameter (CX_GEO_PER_DEFAULT = 0) parameter (CX_GEO_PER_OBJECT = 1) parameter (CX_GEO_PER_PART = 2) parameter (CX_GEO_PER_FACE = 3) parameter (CX_GEO_PER_FACE_INDEXED = 4) parameter (CX_GEO_PER_VERTEX = 5) parameter (CX_GEO_PER_VERTEX_INDEXED = 6)
subroutine cxGeoNormalAdd(n,normal,per) integer n real normal(3, n) integer per
n
Number of normals.
normal
An array of normalized XYZ triples.
per
A flag indicating how normals are to be applied.
This function adds normals to the current point set, line set, polygon set, triangle mesh set, or grid. The current object is the primitive or pushed transform most recently defined, or it may be explicitly set with cxGeoFocus(3E).

Colors may be applied in different ways, depending on the setting of the per flag:

CX_GEO_PER_OBJECT
a single attribute is used over the entire object
CX_GEO_PER_FACE
a different attribute is applied on each face (valid for polygons, triangles, and grids)
CX_GEO_PER_VERTEX
a different attribute is applied per vertex (valid for points, lines, polygons, triangles, and grids)
CX_GEO_PER_VERTEX_INDEXED
a different attribute is applied on each reference to a vertex (valid for lines, polygons, and triangles)

The normals are expected to have been normalized to unit length.

Polygons specified by cxGeoPolysDefine must have their vertices supplied in a counter-clockwise fashion so that the implicit frontfacing/backfacing normal for the polygon is computed correctly according to the "right-hand rule". You cannot use cxGeoNormalAdd to override this frontfacing/backfacing normal computation for purposes of rendering.

cxGeoFocus(3E), cxGeoPolysDefine(3E)
Last modified: Mon Nov 6 16:33:15 GMT 2000
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996