TRIANGLE STRIP 3 WITH DATA(3P+) — Kubota Pacfic Computer Inc. (29 February 1991)
NAME
TRIANGLE STRIP 3 WITH DATA − creates a 3D triangle strip structure element that includes colour and shading data
SYNOPSIS
C Syntax
void
ptri_strip3_data ( fflag, vflag, colour_model, nv, fdata, vdata )
Pintfflag;what data is specified per facet
Pintvflag;what data is specified per vertex
Pintcolour_model;colour model
Pintnv;number of vertices
Pfacet_data_arr3∗fdata; facet data
Pfacet_vdata_arr3∗vdata; facet vertex data
Required PHIGS Operating States
(PHOP, ∗, STOP, ∗)
DESCRIPTION
Purpose
TRIANGLE STRIP 3 WITH DATA places a 3D triangle strip primitive with colour and shading data into the open structure.
C Input Parameters
fflagThe data per facet flag specifies the available data for each facet in the strip.
0PFACET_NONENo Facet Coordinates Specified
1PFACET_COLOURFacet Colours Specified
2PFACET_NORMALFacet Normal Specified
3PFACET_COLOUR_NORMALFacet Normal and Colours Specified
vflagThe data per vertex flag specifies the available data for each vertex of the primitive.
0PVERT_COORDCoordinates Specified
1PVERT_COORD_COLOURCoordinates and Colours Specified
2PVERT_COORD_NORMALCoordinates and Normals Specified
3PVERT_COORD_COLOUR_NORMALCoordinates, Colours, and Normals Specified
colour_model
The colour type for specified vertex colours.
0PINDIRECTColour Index Specified
1PMODEL_RGBRed, Green, and Blue
2PMODEL_CIELUVCIE Colour Model
3PMODEL_HSVHue, Saturation, and Value
4PMODEL_HLSHue, Lightness, and Saturation
nvThe number of vertices.
fdataA pointer, to a Pfacet_data_arr3 structure, that specifies the colours and/or norms information for each facet. Pfacet_data_arr3 is defined as:
typedef union {
Pcoval∗colrs;/∗ array (nv-2) of colours ∗/
Pvec3∗norms;/∗ array (nv-2) of unit normals ∗/
Pconorm3∗conorms;/∗ array (nv-2) of colours and normals ∗/
/∗ implementation-dependent types can go here ∗/
} Pfacet_data_arr3;
Pcoval is defined as:
typedef union {
Pintind;/∗ index in workstation colour bundle table ∗/
Pcolr_repdirect;/∗ direct colour components ∗/
} Pcoval;
Pcolr_rep is defined as:
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;
Phls is defined in phigs.h as follows:
typedef struct {
Pfloathue;/∗ hue ∗/
Pfloatlightness;/∗ lightness ∗/
Pfloatsatur;/∗ saturation ∗/
} Phls;
Phsv is defined in phigs.h as follows:
typedef struct {
Pfloathue;/∗ hue ∗/
Pfloatsatur;/∗ saturation ∗/
Pfloatvalue;/∗ value ∗/
} Phsv;
Pdata is defined in phigs.h as follows:
typedef struct {
size_tsize;/∗ size of data ∗/
char∗data/∗ pointer to data ∗/
} Pdata;
Pvec3 is defined as:
typedef struct {
Pfloatdelta_x;/∗ x magnitude ∗/
Pfloatdelta_y;/∗ y magnitude ∗/
Pfloatdelta_z;/∗ z magnitude ∗/
} Pvec3;
Pconorm3 is defined as:
typedef struct {
Pcovalcolr;/∗ colour ∗/
Pvec3norm;/∗ unit normal ∗/
} Pconorm3;
Pcoval and Pvec3 are defined above.
vdataA pointer, to a Pfacet_vdata_arr3 structure, that specifies the coordinates of each triangle and optionally associated colour information. Pfacet_vdata_arr3 is defined as:
typedef union {
Ppoint3∗points;/∗ array (nv) of points ∗/
Pptco3∗ptcolrs;/∗ array (nv) of points and colours ∗/
Pptnorm3∗ptnorms;/∗ array (nv) of points and normals ∗/
Pptconorm3∗ptconorms;/∗ array (nv) of points, colours, and normals ∗/
/∗ implementation dependent types can go here ∗/
} Pfacet_vdata_arr3;
Ppoint3 is defined as:
typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
Pfloatz;/∗ z coordinate ∗/
} Ppoint3;
Pptco3 is defined as:
typedef struct {
Ppoint3point;/∗ point coordinates ∗/
Pcovalcolr;/∗ colour ∗/
} Pptco3;
Ppoint3 is defined above. Pcoval is defined as:
typedef union {
Pintind;/∗ index in workstation colour bundle table ∗/
Pcolr_repdirect;/∗ direct colour components ∗/
} Pcoval;
Pcolr_rep is defined as:
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;
Phls is defined in phigs.h as follows:
typedef struct {
Pfloathue;/∗ hue ∗/
Pfloatlightness;/∗ lightness ∗/
Pfloatsatur;/∗ saturation ∗/
} Phls;
Phsv is defined in phigs.h as follows:
typedef struct {
Pfloathue;/∗ hue ∗/
Pfloatsatur;/∗ saturation ∗/
Pfloatvalue;/∗ value ∗/
} Phsv;
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:
typedef struct {
Ppoint3point;/∗ point coordinates ∗/
Pvec3norm;/∗ unit normal ∗/
} Pptnorm3;
Ppoint3 is defined above. Pvec3 is defined as:
typedef struct {
Pfloatdelta_x;/∗ x magnitude ∗/
Pfloatdelta_y;/∗ y magnitude ∗/
Pfloatdelta_z;/∗ z magnitude ∗/
} Pvec3;
Pptconorm3 is defined as:
typedef struct {
Ppoint3point;/∗ point coordinates ∗/
Pcovalcolr;/∗ colour ∗/
Pvec3norm;/∗ unit normal ∗/
/∗ point coordinates with colour and unit normal ∗/
} Pptconorm3;
Ppoint3, Pcoval, and Pvec3 are defined above.
Execution
Depending on the edit mode, a TRIANGLE STRIP 3 WITH DATA element is inserted into the open structure after the element pointer, or replaces the element pointed to by the element pointer. In either case, the element pointer is updated to point to the newly created TRIANGLE STRIP 3 WITH DATA element.
When the structure is traversed, TRIANGLE STRIP 3 WITH DATA generates a strip of n-2 connected triangles from n vertices. Line segments form the boundaries of all triangles in the strip. The triangular areas within the strip can be empty, hollow, shaded, or filled with a color, pattern, or hatch style. A strip with less than three vertices can be created, but is ignored during traversal.
TRIANGLE STRIP 3 WITH DATA uses the same attributes as the FILL AREA SET 3 WITH DATA structure element.
The TRIANGLE STRIP 3 WITH DATA element can specify the facet colour and normal vector of each triangle, as well as colours and normal vectors for each vertex. These colours and normal vectors are used in conjunction with the current lighting and depth cueing attributes to colour and shade the primitive. Note that unexpected lighting effects will result if the supplied normals are not of unit length.
Attributes Applied
The attributes listed below are used to display the TRIANGLE STRIP 3 WITH DATA primitive when the structure is traversed. The Aspect Source Flags (ASFs) tell where to access the output display attributes. These attributes can come directly from the traversal state list, or they can be accessed indirectly, using the appropriate index in the traversal state list and the corresponding bundled representation in the PHIGS workstation state list.
interior colourinterior colour index ASF
back interior colourback interior colour ASF
interior styleinterior style ASF
back interior styleback interior style ASF
interior style indexinterior style index ASF
back interior style indexback interior style index ASF
interior shading methodinterior shading method ASF
back interior shading methodback interior shading method ASF
interior reflectance equation interior reflectance equation ASF
back interior reflectance equationback interior reflectance equation ASF
area propertiesarea properties ASF
back area propertiesback area properties ASF
interior index
edge colouredge colour index ASF
edge flagedge flag ASF
edgetypeedgetype ASF
edgewidth scale factoredgewidth scale factor ASF
edge index
face distinguishing mode
face culling mode
depth cue index
light source state
name set
ERRORS
005Ignoring function, function requires state (PHOP, ∗, STOP, ∗)
SEE ALSO
FILL AREA SET 3 WITH DATA (3P+)
September 02, 1992