void pxcomp_fill_area_geo_norm3 (
Pint colr_type, /*color type */
0 PCOLR_INDIRECT indirect color 1 PCOLR_RGB RGB direct color 2 PCOLR_CIELUV CIE direct color 3 PCOLR_HSV HSV direct color 4 PCOLR_HLS HLS direct color
Pvertex3_set *vertex_data, /*vertices and data */ Pint *error_ind, /*error indicator */ Pvec3 *normal /*geometric unit normal */
)
typedef struct {
Pint num_lists; /*number of vertex lists */
Pvertex3_list *vertices; /*list of vertex lists */
} Pvertex3_set ;
typedef struct {
Pint num_vertices; /*number of vertices */
Pint num_data_per_vertex; /*number of data values per vertex */
Ppoint3 *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 */
} Pvertex3_list ;
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:
The normal returned may be combined with the existing vertex data to create a more complete specification for a Fill Area Set 3 With Data. See Fill Area Set 3 With Data (routine pfill_area_set3_data) for details.
Fill area set with data, see pfill_area_set_data, pfill_area_set3_data