NAME

cxGeoNormalAdd - add normals to a geometry object

C SPECIFICATION

#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 )

FORTRAN SPECIFICATION

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

PARAMETERS

n
Number of normals.
normal
An array of normalized XYZ triples.
per
A flag indicating how normals are to be applied.

DESCRIPTION

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.

SEE ALSO

cxGeoFocus(3E), cxGeoPolysDefine(3E)
Last modified: Mon Nov 18 13:49:04 GMT 1996
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996