Previous Next Up Title Contents Index Functions Index Top Library

COMPUTE FILL AREA (SET) GEOMETRIC NORMAL

PXCOMP_FILL_AREA_GEO_NORM


CALL SEQUENCE

void pxcomp_fill_area_geo_norm (
)

TYPES

typedef struct {
	Pint	num_lists;	/*number of vertex lists	*/
	Pvertex_list	*vertices;	/*list of vertex lists	*/
} Pvertex_set ;

typedef struct {
	Pint	num_vertices;	/*number of vertices 	*/
	Pint	num_data_per_vertex;	/*number of data values per vertex	*/
	Ppoint	*vertex_points;	/*list of vertex points	*/
	Pcolrv_ptr	vertex_colrvs;	/*list of vertex colors	*/
	Pvec3	*vertex_norms;	/*list of vertex normals	*/
	Pfloat	*vertex_data;	/*list of vertex data lists 	*/
} Pvertex_list ;

EFFECT

Compute the unit geometric normal of a 2D fill area set with data.

This function returns the unit geometric normal to the given Fill Area Set With Data.

The input data structure contains a list of vertex points which are used for the unit geometric normal calculation. It may also contain vertex color data, vertex normals, and vertex application-specific data, all of which are ignored.

Calculating the Normal

The first three non-collinear points in the data structure, as determined below, are designated A, B, and C. The geometric normal is computed as the cross product of two vectors: the vector from A to B, and the vector from A to C; it is then reduced to unit length.

When calculating the normal for a fill area set, point A is the first point in the first fill area set boundary, point B is the first point in the fill area set boundary which is not identical to point A, and point C is the first point in the fill area set boundary which is not collinear with points A and B. This process is applied to each successive boundary in the set until a triplet is found or all boundaries have been exhausted. If no such triplet exists, Error Indicator is set to a non-zero value, and Geometric Unit Normal is undefined.

Error Indicator will return one of the following values:

0
No error

505
Warning, the fill area is degenerate.

The normal returned may be combined with the existing vertex data to create a more complete specification for a Fill Area Set With Data. See Fill Area Set With Data (routine pfill_area_set_data) for details.


Previous Next Up Title Contents Index Functions Index Top Library