Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ptsd3(3P+) — PHIGS 1.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

TRIANGLE STRIP 3 WITH DATA(3P+)  —  MISC. REFERENCE MANUAL PAGES

NAME

TRIANGLE STRIP 3 WITH DATA − creates a 3D triangle strip structure element that includes colour and shading data

SYNOPSIS

C Syntax

void
ptri3data ( fflag, vflag, colour_model, nv, fdata, vdata )
Pintfflag;data per facet flag
Pintvflag;data per vertex flag
Pintcolour_model;colour model
Pintnv;number of vertices
Pfacetdataarr3∗fdata;pointer to facet data array
Pfacetvdataarr3∗vdata; pointer to facet vertex data array

FORTRAN Syntax

SUBROUTINE ptsd3 ( FFLAG, VFLAG, COLMOD, NV, IFCOLR, FCOLR, FNORM, COORDS,
IVCOLR, VCOLR, VNORM, IMPL )
INTEGERFFLAGdata per facet flag
INTEGERVFLAGdata per vertex flag
INTEGERCOLMODcolour model
INTEGERNVnumber of vertices
INTEGERIFCOLR(NV-2)array of indirect facet colours
REALFCOLR(3,NV-2)array of facet colours
REALFNORM(3,NV-2)array of facet normals
REALCOORDS(3,NV)array of vertex coordinates
INTEGERIVCOLR(NV)array of indirect vertex colours
REALVCOLR(3,NV)array of vertex colours
REALVNORM(3,NV)array of vertex normals
REALIMPL(∗)implementation defined 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. 

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 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 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

nvThe number of vertices. 

fdataA pointer, to a Pfacetdataarr3 structure, that specifies the colours and/or normals information for each facet. Pfacetdataarr3 is defined as:

typedef union {
Pcoval∗colours;/∗ array (nv-2) of colours ∗/
Pvector3∗normals;/∗ array (nv-2) of normals ∗/
Pconorm3∗conorms;/∗ array (nv-2) of colours and normals ∗/
/∗ implementation dependent types can go here ∗/
} Pfacetdataarr3;

Pcoval is defined as:

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

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 struct {
Pcovalcolour;/∗ colour ∗/
Pvector3normal;/∗ normal ∗/
} Pconorm3;

Pcoval and Pvector3 are defined above. 

vdataA pointer, to a Pfacetvdataarr3 structure, that specifies the coordinates of each triangle and optionally associated colour information. Pfacetvdataarr3 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 ∗/
} 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 as:

typedef struct {
Pfloatx;/∗ red, hue, etc ∗/
Pfloaty;/∗ green, saturation, lightness, etc ∗/
Pfloatz;/∗ blue, value, saturation, etc ∗/
} Pcobundl;

Pptnorm3 is defined as:

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

Ppoint3 is defined above.  Pvector3 is defined as:

typedef struct {
Pfloatx;/∗ x magnitude ∗/
Pfloaty;/∗ y magnitude ∗/
Pfloatz;/∗ z magnitude ∗/
} Pvector3;

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. 

FFLAG
The data per facet flag indicates the information specified for each facet of the triangle strip.  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

NVThe number of vertices used to define the triangle strip.  The number of triangles will always be 2 less than the number of vertices (NV-2). 

IFCOLR(NV-2)
An array of integers containing indices into the workstation colour table for each facet or triangle. This array is unused if FFLAG is set to either PFNONE or PFNORM or if COLMOD is greater than PINDIR. 

FCOLR(3,NV-2)
An array of reals containing the colours for each facet. This array is unused if FFLAG is set to either PFNONE or PFNORM or COLMOD is equal to PINDIR. 

FCOLR(1,f) = Red, Hue, etc.
FCOLR(2,f) = Green, Saturation, Lightness, etc.
FCOLR(3,f) = Blue, Value, Saturation, etc.

FNORM(3,NV-2)
An array of reals containing the normals for each facet. 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,NV)
An array of reals containing the x, y, and z coordinates of each of the triangles in the triangle strip. 

COORDS(1,v) = x Coordinate
COORDS(2,v) = y Coordinate
COORDS(3,v) = z Coordinate

IVCOLR(NV)
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 PINDIR. 

VCOLR(3,NV)
An array of reals containing the colours for each vertex. This array is unused if VFLAG is set to either PVCOOR or PVNORM or if COLMOD is equal to PINDIR. 

VCOLR(1,v) = Red, Hue, etc.
VCOLR(2,v) = Green, Saturation, Lightness, etc.
VCOLR(3,v) = Blue, Value, Saturation, etc.

VNORM(3,NV)
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(∗)
IMPL is the implementation defined vertex data. 

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. INTRO PHIGS+(3P+) describes how to use the output display attribute values. 

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 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

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

Sun Release 4.0  —  Last change: 2 August 1989

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