Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

define_texture(3G)

deformation_mod(3G)

drawing_mode(3G)

fill_color(3G)

interior_style(3G)

perimeter_color(3G)

perimeter_repeat_length(3G)

perimeter_type(3G)

polygon(3G)

vertex_format(3G)

texture_index(3G)

write_enable(3G)

triangular_strip(3G)

NAME

triangular_strip, triangular_strip_with_data − defines a series of triangular regions to be filled and/or edged. 

SYNOPSIS

C Syntax:

void triangular_strip(fildes,clist,numverts,gnormals);
int fildes,numverts;
float clist[],gnormals[];

void triangular_strip_with_data(fildes,clist,numverts,
gnormals,numcoord,
vertex_flags,facet_flags);
int fildes,numverts,numcoord,vertex_flags,facet_flags;
float clist[],gnormals[];

FORTRAN77 Syntax:

subroutine triangular_strip(fildes,clist,numverts,gnormals)
integer∗4 fildes,numverts
real clist(numverts∗3),gnormals((numverts−2)∗3)

subroutine triangular_strip_with_data(fildes,clist,numverts,
gnormals,numcoord,vertex_flags,facet_flags)
integer∗4 fildes,numverts,numcoord,vertex_flags,facet_flags
real clist(numverts∗(3+numcoord)),gnormals((numverts−2)∗3)

Pascal Syntax:

procedure triangular_strip(fildes:integer; var clist:array[lo..hi:integer] of real; numverts:integer; var gnormals:array[lo..hi:integer] of real);

procedure triangular_strip_with_data(fildes:integer; var clist:array[lo..hi:integer] of real; numverts:integer; var gnormals:array[lo..hi:integer] of real; numcoord,vertex_flags,facet_flags:integer);

DESCRIPTION

Input Parameters

fildes Integer file descriptor returned by gopen when an I/O path to a graphics device is opened. 

clist array of three dimensional real endpoint data

numverts number of strip vertices in the clist array. 

gnormals array of real geometric normals. 

numcoord the number of extra coordinates in the vertex data. This includes the data specified in vertex_flags. 

vertex_flags describes the definition of the extra vertex data. 

facet_flags describes the format of polygons. 

Discussion

These procedures are similar with the exception that in the triangular_strip_with_data procedure the vertex data format is specified in the clist of vertices and is not derived from the vertex_format procedure. The triangular_strip procedure uses the vertex_format procedure. 
 
A boundary of a series of triangular regions is defined by connecting each vertex to its two successors in the coordinate list.  The first triangle is formed from vertices 1,2,3 and the second triangle from vertices 2,3,4.  The last triangle if formed from the last three vertices in the clist (numverts, numverts-1, numverts-2). 
 
If vertex_format is specified to include a normal per polygon, or if FACET_NORMAL is specified in vertex_flags then this normal is extracted from the gnormals array.  The first three entries of this array are x,y,z coordinates of the normal for the first triangle.  The second three entries are the normal for the second triangle and so on.  If there are no normals per polygon then the gnormals value may be null. 
 
triangular_strip uses the current fill color and perimeter attributes.  Each triangle is filled and/or outlined according to the current interior style.  As with all output primitives it is affected by the current drawing mode and write_enable. 
 
For triangular_strip_with_data, each entry in the clist can contain any number of coordinates.  The actual number depends on the numcoord parameter.  The use of the additional data is specified with the vertex_flags parameter.  The additional data starts after the z coordinate and is assumed to be omitted if not specified.  The flags for vertex_data define the additional data and imply its order in the clist. 

The following table describes the vertex flags which can be ORed together, their expected order, and indicates (YES) for flags that are utilized, (OK) for flags that may be present but are ignored, and (NO) for flags that must not be present (error condition):
 




Vertex Flag Description



NULL none of the extra data is to be used for rendering YES
VERTEX_INTENSITY a single intensity value YES
VERTEX_COLOR an (r,g,b) triple at the vertex YES
VERTEX_NORMAL an (nx,ny,nz) normal at the vertex YES
TEXTURE_MAP a coordinate (u,v) into a texture map YES
VERTEX_BLEND a blending factor for combination with existing pixels YES
ILLUMINATION illumination factors for each light source YES
DEFORMATION complex deformation factors for each axis YES
CONTOURING front and back facing scalar contouring values per vertex NO
MD_FLAGS a move/draw flag NO

 
 
 

The ILLUMINATION flag specifies that data is present containing 4-bit illumination factors for light sources.  By default, there are two words of data which provide factors for 16 light sources.  The amount of data used for illumination may be changed via the gescape ILLUMINATION_BLEND. 

Each of these factors has a range of 0 (0%) to 15 (100%) and indicate the amount of light directly available or indirectly available from each light source.  The four least significant bits of the first word contains the factor for light source zero, the next four bits the factor for light source one and so on.  The four least significant bits of the second word contains the factor for light source eight, the next four bits the factor for light source nine and so on.  These factors are used to generate soft shadows. 

The DEFORMATION flag specifies that complex deformation values are present.  Whether to use the real or imaginary portion of the deformation factor/deformation values product and the deformation factor (df + dfi below) are specified in the deformation_mode procedure.  The per vertex deformation values are in the following order:  fx,fy,fz,fxi,fyi,fzi.  Prior to processing the polygon all of the vertices are deformed by the following calculations:
 

x = x + (df + dfi) * (fx + fxi)
y = y + (df + dfi) * (fy + fyi)
z = z + (df + dfi) * (fz + fzi)

All of the values may be specified alone or bitwise ORed together in any combination except that VERTEX_INTENSITY and VERTEX_COLOR may not be combined.  If they are specified together, then the procedure will generate an error and exit. 

As an example, if a vertex_flags of TEXTURE_MAP | VERTEX_BLEND is specified, and numcoord is set to 6, then (x,y,z,u,v,blend,ad,ad,ad) would be the composition of each vertex, where ad = application dependent data not used for rendering. 

The format of the polygonal and additional data is specified by the facet_flags parameter.  The meaning of the inclusive OR parameters is:

The following table describes the facet flags which can be ORed together, their expected order, and indicates (YES) for flags that are utilized, (OK) for flags that may be present but are ignored, and (NO) for flags that must not be present (error condition):
 
 




Facet Flag Description
NULL no facet flags are provided YES
FACET_COLOR an rgb color triad is supplied in flist for each facet NO
FACET_NORMAL a normal vector supplied in flist for each facet YES
EDGE_FLAG edge visibility flag NO
CLOCKWISE facet vertices arranged in clockwise format (front face) YES
COUNTER_CLOCKWISE facet vertices arranged in counter clockwise format YES
UNIT_NORMALS vertex and facet normal vectors are normalized YES

 

The clockwise/counter_clockwise direction of facet
vertices is determined by the presence of the CLOCKWISE or
COUNTER_CLOCKWISE flag[s].  If neither flag is present, the facet
vertices are assumed clockwise.  (If both flags are present, the
vertices are assumed to be counter clockwise).

SEE ALSO

define_texture(3G), deformation_mod(3G), drawing_mode(3G), fill_color(3G), interior_style(3G), perimeter_color(3G), perimeter_repeat_length(3G), perimeter_type(3G), polygon(3G), vertex_format(3G), texture_index(3G), write_enable(3G). 

Hewlett-Packard Company  —  HP-UX Release 9.03: April 1994

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