quadrilateral_mesh(3G)
NAME
quadrilateral_mesh, quadrilateral_mesh_with_data − defines a series of quadrilateral regions to be filled and/or edged.
SYNOPSIS
C Syntax:
void quadrilateral_mesh(fildes,clist, numverts_m,numverts_n,gnormals);
int fildes,numverts_m,numverts_n;
float clist[],gnormals[];
void quadrilateral_mesh_with_data(fildes,clist, numverts_m,numverts_n, gnormals,numcoord,vertex_flags,facet_flags);
int fildes,numverts_m,numverts_n,numcoord, vertex_flags,facet_flags;
float clist[],gnormals[];
FORTRAN77 Syntax:
subroutine quadrilateral_mesh(fildes,clist, numverts_m,numverts_n,gnormals)
integer*4 fildes,numverts_m,numverts_n
real clist(numverts_m∗numverts_n∗3), gnormals((numverts_m−1)∗(numverts_n−1)∗3)
subroutine quadrilateral_mesh_with_data(fildes,clist, numverts_m,numverts_n,gnormals,numcoord,vertex_flags, facet_flags)
integer*4 fildes,numverts_m,numverts_n,numcoord, vertex_flags,facet_flags
real clist(numverts_m∗numverts_n∗(3+numcoord)), gnormals((numverts_m−1)∗(numverts_n−1)∗3)
Pascal Syntax:
procedure quadrilateral_mesh(fildes:integer; var clist:array[lo..hi:integer] of real; numverts_m,numverts_n:integer; var gnormals:array[lo..hi:integer] of real);
procedure quadrilateral_mesh_with_data(fildes:integer; var clist:array[lo..hi:integer] of real; numverts_m,numverts_n: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 stored in row major format
numverts_m number of rows in the clist array.
numverts_n number of columns 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 vertex data.
facet_flags describes the format of the polygons.
Discussion
These procedures are similar except that for the quadrilateral_mesh_with_data procedure the vertex data format is specified in the procedure and is not derived from the vertex_format procedure.
The list of points is a two dimensional array where each set of four neighboring points defines a quadrilateral. The first quadrilateral consists of the first two points from the first row and the first two points from the second row. The second quadrilateral consists of the second and third points from the first row and the second and third points from the second row and so on.
If vertex_format is specified to include a normal per polygon or FACET_NORMAL is specified in facet_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 quadrilateral. The second three entries are the normal for the second quadrilateral if normals per vertex are present, and so on. If there are no normals per polygon then the gnormals value may be null.
Each quadrilateral is filled and/or outlined according to the current interior style. Quadrilateral_mesh uses the current fill color and perimeter attributes. As with all output primitives it is affected by the current drawing mode and write enable.
For quadrilateral_mesh_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 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 |
ILLUMINATION specifies that data is present containing 4-bit illumination factors for light sources. As a default, there are two words of data which allows for factors for 16 light sources. The amount of data used for illumination may be changed via a gescape. 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.
DEFORMATION 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 ORed in any combination except that VERTEX_INTENSITY and VERTEX_COLOR may not be specified together. If they are specified together, 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 quadrilateral’s polygons and additional data is specified by the facet_flags parameter.
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).
The CLOCKWISE/COUNTER_CLOCKWISE direction of polygon vertices effects the order in which vertices are used to generate quadrilaterals.
For example, if the order is COUNTER_CLOCKWISE, then:
The 1st vertex in the 1st row is the 1st vertex of the 1st quadrilateral.
The 2nd vertex in the 1st row is the 2nd vertex of the 1st quadrilateral.
The 2nd vertex in the 2nd row is the 3rd vertex of the 1st quadrilateral.
The 1st vertex in the 2nd row is the 4th vertex of the 1st quadrilateral.
If the order is CLOCKWISE, then:
The 1st vertex in the 1st row is the 1st vertex of the 1st quadrilateral.
The 1st vertex in the 2nd row is the 2nd vertex of the 1st quadrilateral.
The 2nd vertex in the 2nd row is the 3rd vertex of the 1st quadrilateral.
The 2nd vertex in the 1st row is the 4th vertex of the 1st quadrilateral.
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), texture_index(3G), vertex_format(3G), write_enable(3G).
Hewlett-Packard Company — HP-UX Release 9.10: April 1995