QUADRILATERAL MESH 3 WITH DATA(3P+) — MISC. REFERENCE MANUAL PAGES
NAME
QUADRILATERAL MESH 3 WITH DATA − creates a 3D quadrilateral mesh structure element that includes colour and shading data
SYNOPSIS
C Syntax
void
pquad3data ( 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 model
Pdim∗dim;dimension of cells (in vertices)
Pfacetdataarr3∗fdata;facet data
Pfacetvdataarr3∗vdata; vertex data
FORTRAN Syntax
SUBROUTINE pmed3 ( FFLAG, VFLAG, COLMOD, VROWS, VCOLS, IFCOLR, FCOLR, FNORM,
COORDS, IVCOLR, VCOLR, VNORM, IMPL )
INTEGERFFLAGdata per facet flag
INTEGERVFLAGdata per vertex flag
INTEGERCOLMODcolour model
INTEGERVROWSnumber of vertices along y axis
INTEGERVCOLSnumber of vertices along x axis
INTEGERIFCOLR((VROWS-1)∗(VCOLS-1)) array of indirect facet colours
REALFCOLR(3,((VROWS-1)∗(VCOLS-1))) array of facet colours
REALFNORM(3,((VROWS-1)∗(VCOLS-1))) array of facet normals
REALCOORDS(3,VROWS∗VCOLS) array of vertex coordinates
INTEGERIVCOLR(VROWS∗VCOLS)array of indirect vertex colours
REALVCOLR(3,VROWS∗VCOLS)array of vertex colours
REALVNORM(3,VROWS∗VCOLS) array of vertex normals
REALIMPL(∗)implementation defined 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.
This is a SunPHIGS Extension function based on PHIGS+ and is not part of the PHIGS standard.
C Input Parameters
All of the following data types are predefined in phigs.h.
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 model specifies the colour type for specified vertex colours.
0PINDIRECTColour Index Specified
1PRGBRed, Green, and Blue
2PCIECIE Colour Model
3PHSVHue, Saturation, and Value
4PHLSHue, Lightness, and Saturation
dimA pointer to a Pdim structure that specifies the number of vertices along the x and y coordinates. Pdim is defined as:
typedef struct {
Pintx_dim;/∗ number of vertices along the x-axis ∗/
Pinty_dim;/∗ number of vertices along the y-axis ∗/
} Pdim;
fdataA pointer, to a Pfacetdataarr3 structure, that specifies the colour and/or normal information for each facet. Note that number of facets = (x_dim - 1) ∗ (y_dim - 1). Pfacetdataarr3 is defined as:
typedef union {
Pcoval∗colours;/∗ array (x_dim - 1) ∗ (y_dim - 1) of colours ∗/
Pvector3∗normals;/∗ array (x_dim - 1) ∗ (y_dim - 1) of normals ∗/
Pconorm3∗conorms;/∗ array (x_dim - 1) ∗ (y_dim - 1) of colours and normals ∗/
} Pfacetdataarr3;
Pcoval is defined as:
typedef union {
Pintindex;/∗ index in workstation colour bundle table ∗/
Pcobundldirect;/∗ direct colour components ∗/
} Pcoval;
When colour_model is PINDIRECT, index is used; otherwise, direct is used.
Pcobundl is defined as:
typedef struct {
Pfloatx;/∗ red, hue, etc ∗/
Pfloaty;/∗ green, saturation, lightness, etc ∗/
Pfloatz;/∗ blue, value, saturation, etc ∗/
} Pcobundl;
Pvector3 is defined as:
typedef struct {
Pfloatx;/∗ x magnitude ∗/
Pfloaty;/∗ y magnitude ∗/
Pfloatz;/∗ z magnitude ∗/
} Pvector3;
Pconorm3 is defined as:
typedef union {
Pcovalcolour;/∗ colour ∗/
Pvector3normal;/∗ normal ∗/
} Pconorm3;
Pcoval and Pvector3 are defined above.
vdataA pointer, to a Pfacetvdataarr3 structure, that specifies the quadrilateral mesh vertices and optionally associated colour and normal information. Pfacetvdataarr3 is defined as:
typedef union {
Ppoint3∗points;/∗ array of (x_dim ∗ y_dim) of points ∗/
Pptco3∗ptcolrs;/∗ array of (x_dim ∗ y_dim) of points and colours ∗/
Pptnorm3∗ptnorms;/∗ array of (x_dim ∗ y_dim) of points and normals ∗/
Pptconorm3∗ptconorms;/∗ array of (x_dim ∗ y_dim) of points, colours, and normals ∗/
/∗ implementation dependent types can go here ∗/
} Pfacetvdataarr3;
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 ∗/
Pcovalcolour;/∗ colour ∗/
} Pptco3;
Ppoint3 is defined above. Pcoval is defined as:
typedef union {
Pintindex;/∗ index in workstation colour bundle table ∗/
Pcobundldirect;/∗ direct colour components ∗/
} Pcoval;
Pcobundl is defined above. Pptnorm3 is defined as:
typedef struct {
Ppoint3point;/∗ point coordinates ∗/
Pvector3normal;/∗ normal ∗/
} Pptnorm3;
Ppoint3 and Pvector3 are defined above. Pptconorm3 is defined as:
typedef struct {
Ppoint3point;/∗ point coordinates ∗/
Pcovalcolour;/∗ colour ∗/
Pvector3normal;/∗ normal ∗/
/∗ point coordinates with colour and normal ∗/
} Pptconorm3;
Ppoint3, Pcoval, and Pvector3 are defined above.
FORTRAN Input Parameters
All of the following data types are predefined in phigs77.h.
Note: The following arrays are row major: IFCOLR, FCOLR, FNORM, COORDS, IVCOLR, VCOLR, and VNORM.
FFLAG
The data per facet flag indicates the information specified for each facet of the quadrilateral mesh. The possible values are:
0PFNONENo Facet Data Specified
1PFCLRFacet Colour Specified
2PFNORMFacet Normal Specified
3PFCLRNFacet Colour and Normal Specified
VFLAG
The data per vertex flag indicates the information specified with each vertex of the primitive. The possible values are:
0PVCOORCoordinates Only
1PVCLRCoordinates and Colours
2PVNORMCoordinates and Normals
3PVCLRNCoordinates, Colours, and Normals
COLMOD
The colour model. If the data per facet flag (FFLAG) indicates that a facet colour is specified, or if the data per vertex flag (VFLAG) indicates that vertex colours are specified, then COLMOD is set to one of the following:
0PINDIRColour Index Specified
1PRGBRed, Green, and Blue
2PCIECIE Colour Model
3PHSVHue, Saturation, and Value
4PHLSHue, Lightness, and Saturation
VROWS
The number of vertices along the y axis of the quadrilateral strip.
VCOLS
The number of vertices along the x axis of the quadrilateral strip.
Note:The total number of vertices in the quadrilateral strip is the product of the number of vertices along the y axis and the number of vertices along the x axis (VROWS ∗ VCOLS). The number of quadrilateral facets produced will be (VROWS-1) ∗ (VCOLS-1).
IFCOLR((VROWS-1)∗(VCOLS-1))
An array of integers containing indices into the workstation colour table for each facet or quadrilateral. The number of facets is equal to (VROWS-1) ∗ (VCOLS-1). This array is unused if FFLAG is set to either PFNONE or PFNORM or if COLMOD is greater than zero.
FCOLR(3,((VROWS-1)∗(VCOLS-1)))
An array of reals containing the colours for each facet. The number of facets is equal to (VROWS-1) ∗ (VCOLS-1). This array is unused if FFLAG is set to either PFNONE or PFNORM or COLMOD is equal to zero.
FCOLR(1,f) = Red, Hue, etc.
FCOLR(2,f) = Green, Saturation, Lightness, etc.
FCOLR(3,f) = Blue, Value, Saturation, etc.
FNORM(3,((VROWS-1)∗(VCOLS-1)))
An array of reals containing the normals for each facet. The number of facets is equal to (VROWS-1) ∗ (VCOLS-1). This array is unused if FFLAG is set to either PFNONE or PFCLR.
FNORM(1,f) = x Magnitude
FNORM(2,f) = y Magnitude
FNORM(3,f) = z Magnitude
COORDS(3,VROWS∗VCOLS)
An array of reals containing the x, y, and z coordinates of the quadrilaterals, where the data in each set of four neighboring array elements defines a quadrilateral.
COORDS(1,v) = x Coordinate
COORDS(2,v) = y Coordinate
COORDS(3,v) = z Coordinate
IVCOLR(VROWS∗VCOLS)
An array of integers containing indices into the workstation colour table for each vertex. This array is unused if VFLAG is set to either PVCOOR or PVNORM or if COLMOD is greater than zero.
VCOLR(3,VROWS∗VCOLS)
An array of reals containing the colours for each vertex. This array is unused if VFLAG is set to either PVCOOR or PVERTCOORNORMAL or COLMOD is equal to zero.
VCOLR(1,v) = Red, Hue, etc.
VCOLR(2,v) = Green, Saturation, Lightness, etc.
VCOLR(3,v) = Blue, Value, Saturation, etc.
VNORM(3,VROWS∗VCOLS)
An array of reals containing the normals for each vertex. This array is unused if VFLAG is set to either PVCOOR or PVCLR.
VNORM(1,v) = x Magnitude
VNORM(2,v) = y Magnitude
VNORM(3,v) = z Magnitude
IMPL(∗)
Implementation defined vertex data.
Execution
Depending on the edit mode, a QUADRILATERAL MESH 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 QUADRILATERAL MESH 3 WITH DATA element.
When the structure is traversed, QUADRILATERAL MESH 3 WITH DATA generates a three dimensional mesh of (n-1) × (m-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 non-planar quadrilateral is decomposed into two triangles when its interior is rendered. A mesh with n < 2 or m < 2 vertices can be created, but is ignored during traversal.
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. INTRO PHIGS+(3P+) describes how to use the output display attribute values.
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 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,∗)
900Storage overflow has occurred in PHIGS
2004FORTRAN-specific binding error: ignoring function, input parameter size out of range
SEE ALSO
FILL AREA SET 3 WITH DATA (3P+)
INTRO PHIGS+ (3P+)
Sun Release 4.0 — Last change: 2 August 1989