Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

QUADRILATERAL MESH 3 WITH DATA(3P+)  —  Kubota Pacfic Computer Inc. (29 February 1991)

NAME

QUADRILATERAL MESH 3 WITH DATA − creates a 3D quadrilateral mesh structure element that includes colour and shading data

SYNOPSIS

C Syntax

void
pquad_mesh3_data ( fflag, vflag, colour_model, dim, fdata, vdata )
Pintfflag; what data per fill facet is available
Pintvflag; what data per vertex is available
Pintcolour_model;colour type
Pint_size∗dim;dimension of cells (in vertices)
Pfacet_data_arr3∗fdata; facet data
Pfacet_vdata_arr3∗vdata; vertex data

Required PHIGS Operating States

(PHOP, ∗, STOP, ∗)

DESCRIPTION

Purpose

QUADRILATERAL MESH 3 WITH DATA creates a 3D quadrilateral mesh primitive with colour and shading data. 

C Input Parameters

fflagThe data per facet flag specifies the available data for each quadrilateral of the quadrilateral mesh. 

0PFACET_NONENo Facet Data 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 Vertex Normal Specified
3PVERT_COORD_COLOUR_NORMALCoordinates, Vertex Colour, and Vertex Normal 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

dimA pointer to a Pint_size structure that specifies the number of vertices along the x and y coordinates. Pint_size is defined in phigs.h as follows:

typedef struct {
Pintsize_x;/∗ number of vertices along the x-axis ∗/
Pintsize_y;/∗ number of vertices along the y-axis ∗/
} Pint_size;

fdataA pointer to a Pfacet_data_arr3 structure that specifies the colour and/or normal information for each facet.  Note that number of facets = (size_x - 1) ∗ (size_y - 1). Pfacet_data_arr3 is defined in phigs.h as follows:

typedef union {
Pcoval∗colrs;/∗ array (size_x - 1) ∗ (size_y - 1) of colours ∗/
Pvec3∗norms;/∗ array (size_x - 1) ∗ (size_y - 1) of unit normals ∗/
Pconorm3∗conorms;/∗ array (size_x - 1) ∗ (size_y - 1) of colours and normals ∗/
} Pfacet_data_arr3;

Pcoval is defined in phigs.h as follows:

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

When colour_model is PINDIRECT, index is used; otherwise, direct is used. 

Pcolr_rep is defined in phigs.h 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;

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 union {
Pcovalcolr;/∗ colour ∗/
Pvec3norm;/∗ unit normal ∗/
} Pconorm3;

Pcoval and Pvec3 are defined above. 

vdataA pointer to a Pfacet_vdata_arr3 structure that specifies the quadrilateral mesh vertices and optionally associated colour and normal information.  Pfacet_vdata_arr3 is defined as:

typedef union {
Ppoint3∗points;/∗ array of (size_x ∗ size_y) of points ∗/
Pptco3∗ptcolrs;/∗ array of (size_x ∗ size_y) of points and colours ∗/
Pptnorm3∗ptnorms;/∗ array of (size_x ∗ size_y) of points and normals ∗/
Pptconorm3∗ptconorms;/∗ array of (size_x ∗ size_y) 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 above.  Pptnorm3 is defined as:

typedef struct {
Ppoint3point; /∗ point coordinates ∗/
Pvec3norm;/∗ unit normal ∗/
} Pptnorm3;

Ppoint3 and Pvec3 are defined above.  Pptconorm3 is defined as:

typedef struct {
Ppoint3point;/∗ point coordinates ∗/
Pcovalcolr;/∗ colour ∗/
Pvec3norm;/∗ unit normal ∗/
} Pptconorm3;

Ppoint3, Pcoval, and Pvec3 are defined above. 

Execution

Depending on the edit mode, a QUADRILATERAL MESH 3 WITH DATA element is inserted into the open structure after the element pointer, or it replaces the element pointed to by the element pointer.  In either case, the element pointer is updated to point to the newly created QUADRILATERAL MESH 3 WITH DATA element. 

When the structure is traversed, QUADRILATERAL MESH 3 WITH DATA generates a three-dimensional mesh of (m-1) × (n-1) quadrilaterals from a two-dimensional array of m × n vertices.  Line segments form the boundary of each quadrilateral in the mesh.  Each quadrilateral can be rendered empty, hollow, shaded, or filled with a colour, pattern, or hatch style. A mesh with n < 2 or m < 2 vertices can be created, but it is treated in a workstation-dependent fashion. 

QUADRILATERAL MESH 3 WITH DATA uses the same attributes as the FILL AREA SET 3 WITH DATA primitive. 

The QUADRILATERAL MESH 3 WITH DATA element can specify the facet colour and normal vector of each quadrilateral in the mesh, 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 QUADRILATERAL MESH 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

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