Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

COMPUTE FILL AREA SET GEOMETRIC NORMAL(3P+)  —  Kubota Pacfic Computer Inc. (29 February 1991)

NAME

COMPUTE FILL AREA SET GEOMETRIC NORMAL −  compute geometric normal of the fill area set

SYNOPSIS

C Syntax

void
pcomp_fill_area_set_gnorm ( vflag, nfa, vdata, error_ind, normal )
Pintvflag;what vertex data is available
Pintnfa;number of fill areas
Pfacet_vdata_list3∗vdata; fill area data
Pint∗error_ind;OUT error indicator
Pvec3∗normal;OUT geometric normal

Required PHIGS Operating States

(PHOP, ∗, ∗, ∗)

DESCRIPTION

Purpose

COMPUTE FILL AREA SET GEOMETRIC NORMAL computes the geometric normal of the fill area set. 

This is a PHIGS Extension function based on PHIGS PLUS and is not part of the PHIGS standard. 

C Input Parameters

All of the following data types are predefined in phigs.h. 

vflagThe data per vertex flag specifies the available data for each vertex of the primitive. 

0PVERT_COORDCoordinates Specified
1PVERT_COORD_COLOURCoordinates and Vertex Colour Specified
2PVERT_COORD_NORMALCoordinates and Vertex Normal Specified
3PVERT_COORD_COLOUR_NORMALCoordinates, Vertex Colour, and
Vertex Normal Specified

nfaThe number of fill areas in the set. 

vdataA pointer, to a list of nfa Pfacet_vdata_list3 structures, that specifies the fill area set and optionally associated colour information. Pfacet_vdata_list3 is defined as follows:

typedef struct {
Pintnum_vertices;/∗ number of vertices ∗/
Pfacet_vdata_arr3vertex_data;/∗ array of facet vertex data ∗/
} Pfacet_vdata_list3;

Pfacet_vdata_arr3 is defined as follows:

typedef union {
Ppoint3∗points;/∗ point ∗/
Pptco3∗ptcolrs;/∗ point and color ∗/
Pptnorm3∗ptnorms;/∗ point and normal ∗/
Pptconorm3∗ptconorms;/∗ point, color, and norml ∗/
/∗ implementation dependent types can go here ∗/
} Pfacet_vdata_arr3;

Ppoint3 is defined as follows:

typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
Pfloatz;/∗ z coordinate ∗/
} Ppoint3;

Pptco3 is defined as follows:

typedef struct {
Ppoint3point;/∗ point coordinates ∗/
Pcovalcolr;/∗ colour ∗/
} Pptco3;

Ppoint3 is defined above.  Pcoval is defined as follows:

typedef union {
Pintindex;/∗ index in workstation colour bundle table ∗/
Pcolr_repdirect;/∗ direct colour components ∗/
} Pcoval;

Pcolr_rep is defined as follows:

typedef union {
Prgbrgb;/∗ Red Green Blue colour specification ∗/
Pcieluvcieluv;/∗ CIE L∗U∗V∗ colour specification ∗/
Phlshls;/∗ Hue Lightness Saturation colour specification ∗/
Phsvhsv;/∗ Hue Saturation Value colour specification ∗/
Pdataunsupp;/∗ Colour in unsupported colour model ∗/
} Pcolr_rep

Prgb is defined in phigs.h as follows:

typedef struct {
Pfloatred;/∗ red, hue, etc ∗/
Pfloatgreen;/∗ green, saturation, lightness, etc ∗/
Pfloatblue;/∗ blue, value, saturation, etc ∗/
} Prgb;

Pcieluv is defined in phigs.h as follows:

typedef struct {
Pfloatcieluv_x;/∗ x coefficient ∗/
Pfloatcieluv_y;/∗ y coefficient ∗/
Pfloatcieluv_y_lum; /∗ y luminance ∗/
} Pcieluv;

Phsv is defined in phigs.h as follows:

typedef struct {
Pfloathue;/∗ hue ∗/
Pfloatsatur;/∗ saturation ∗/
Pfloatvalue;/∗ value ∗/
} Phsv;

Phls is defined in phigs.h as follows:

typedef struct {
Pfloathue;/∗ hue ∗/
Pfloatlightness;/∗ lightness ∗/
Pfloatsatur;/∗ saturation ∗/
} Phls;

Pdata is defined in phigs.h as follows:

typedef struct {
size_tsize;/∗ size of data ∗/
char∗data/∗ pointer to data ∗/
} Pdata;

Pptnorm3 is defined as follows:

typedef struct {
Ppoint3point; /∗ point coordinates ∗/
Pvec3normal; /∗ norm ∗/
} Pptnorm3;

Ppoint3 is defined above.  Pvec3 is defined as follows:

typedef struct {
Pfloatx_val;/∗ x magnitude ∗/
Pfloaty_val;/∗ y magnitude ∗/
Pfloatz_val;/∗ z magnitude ∗/
} Pvec3;

Pptconorm3 is defined as follows:

typedef struct {
Ppoint3point;/∗ point coordinates ∗/
Pcovalcolr;/∗ colour ∗/
Pvec3normal;/∗ norm ∗/
} Pptconorm3;

Ppoint3, Pcoval, and Pvec3 are defined above. 

C Output Parameters

error_ind
A pointer to the location to store the error number.

normA pointer to the location to store the computed geometric normal. (Pvec3 is defined above.) 

Execution

The normalized geometric norm is computed for the fill area set defined by the supplied vertex coordinates. The geometric normal is computed by first selecting three points: A, B, and C.  Point A is the first point in the first list of vertices.  Point B is the next point in that list that is noncoincident with A.  Point C is the next point in that list, after B, that is noncolinear with A and B. The geometric normal is the cross product of the vector extending from A to B with the vector extending from A to C. 

If it is not possible to find three such points in the first list of vertices, then the rest of the lists are searched in order to select three appropriate points from a single list. In case the search fails in all lists, then it is determined that the fill area set is degenerate. 

ERRORS

002Ignoring function, function requires state (PHOP,∗,∗,∗)

612Warning, the fill area is degenerate

SEE ALSO

FILL AREA SET 3 (3P)
FILL AREA SET 3 WITH DATA (3P+)

September 02, 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026