1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
'\" e
'\"! eqn | mmdoc
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp Jan 14 18:30
.ds Dm 01 evalmesh.
.ds Xs 32277 7 evalmesh.gl
.TH GLEVALMESH 3G
.SH NAME
.B "glEvalMesh1, glEvalMesh2
\- compute a one- or two-dimensional grid of points or lines
.SH C SPECIFICATION
void \f3glEvalMesh1\fP(
GLenum \fImode\fP,
.nf
.ta \w'\f3void \fPglEvalMesh1( 'u
GLint \fIi1\fP,
GLint \fIi2\fP )
.fi
.EQ
delim $$
.EN
.SH PARAMETERS
.TP \w'\f2mode\fP\ \ 'u
\f2mode\fP
In \%\f3glEvalMesh1\fP, specifies whether to compute a one-dimensional mesh of points or lines.
Symbolic constants
\%\f3GL_POINT\fP and
\%\f3GL_LINE\fP are accepted.
.TP
\f2i1\fP, \f2i2\fP
Specify the first and last integer values for grid domain variable $i$.
.SH C SPECIFICATION
void \f3glEvalMesh2\fP(
GLenum \fImode\fP,
.nf
.ta \w'\f3void \fPglEvalMesh2( 'u
GLint \fIi1\fP,
GLint \fIi2\fP,
GLint \fIj1\fP,
GLint \fIj2\fP )
.fi
.SH PARAMETERS
.TP
\f2mode\fP
In \%\f3glEvalMesh2\fP, specifies whether to compute a two-dimensional mesh of points, lines,
or polygons.
Symbolic constants
\%\f3GL_POINT\fP,
\%\f3GL_LINE\fP, and
\%\f3GL_FILL\fP are accepted.
.TP
\f2i1\fP, \f2i2\fP
Specify the first and last integer values for grid domain variable $i$.
.TP
\f2j1\fP, \f2j2\fP
Specify the first and last integer values for grid domain variable $j$.
.SH DESCRIPTION
\%\f3glMapGrid\fP and \%\f3glEvalMesh\fP are used in tandem to efficiently
generate and evaluate a series of evenly-spaced map domain values.
\%\f3glEvalMesh\fP steps through the integer domain of a one- or two-dimensional grid,
whose range is the domain of the evaluation maps specified by
\%\f3glMap1\fP and \%\f3glMap2\fP.
\f2mode\fP determines whether the resulting vertices are connected as
points,
lines,
or filled polygons.
.P
In the one-dimensional case,
\%\f3glEvalMesh1\fP,
the mesh is generated as if the following code fragment were executed:
.nf
.IP
\f7
glBegin( \f2type\f7 );
for ( i = \f2i1\fP; i <= \f2i2\fP; i += 1 )
glEvalCoord1( i$^cdot^DELTA u ~+~ u sub 1$ );
glEnd();
\fP
.RE
.fi
where
.sp
.in
$ DELTA u ~=~ (u sub 2 ~-~ u sub 1 ) ^/^ n$
.sp
.in 0
.P
and $n$, $u sub 1$, and $u sub 2$ are the arguments to the most recent
\%\f3glMapGrid1\fP command.
\f2type\fP is \%\f3GL_POINTS\fP if \f2mode\fP is \%\f3GL_POINT\fP,
or \%\f3GL_LINES\fP if \f2mode\fP is \%\f3GL_LINE\fP.
.P
The one absolute numeric requirement is that if $i ~=~ n$, then the
value computed from $ i^cdot^DELTA u ~+~ u sub 1$ is exactly $u sub 2$.
.P
In the two-dimensional case, \%\f3glEvalMesh2\fP, let
.nf
.IP
$ DELTA u ~=~ mark ( u sub 2 ~-~ u sub 1 ) ^/^ n$
.sp
$ DELTA v ~=~ lineup ( v sub 2 ~-~ v sub 1 ) ^/^ m$,
.fi
.RE
.P
where $n$, $u sub 1$, $u sub 2$, $m$, $v sub 1$, and $v sub 2$ are the
arguments to the most recent \%\f3glMapGrid2\fP command. Then, if
\f2mode\fP is \%\f3GL_FILL\fP, the \%\f3glEvalMesh2\fP command is equivalent
to:
.nf
.IP
\f7
for ( j = \f2j1\fP; j < \f2j2\fP; j += 1 ) {
glBegin( GL_QUAD_STRIP );
for ( i = \f2i1\fP; i <= \f2i2\fP; i += 1 ) {
glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, j$^cdot^DELTA v ~+~ v sub 1$ );
glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, (j+1)$^cdot^DELTA v ~+~ v sub 1$ );
}
glEnd();
}
\fP
.RE
.fi
.P
If \f2mode\fP is \%\f3GL_LINE\fP, then a call to \%\f3glEvalMesh2\fP is equivalent to:
.nf
.IP
\f7
for ( j = \f2j1\fP; j <= \f2j2\fP; j += 1 ) {
glBegin( GL_LINE_STRIP );
for ( i = \f2i1\fP; i <= \f2i2\fP; i += 1 )
glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, j$^cdot^DELTA v ~+~ v sub 1$ );
glEnd();
}
.sp
for ( i = \f2i1\fP; i <= \f2i2\fP; i += 1 ) {
glBegin( GL_LINE_STRIP );
for ( j = \f2j1\fP; j <= \f2j1\fP; j += 1 )
glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, j$^cdot^DELTA v ~+~ v sub 1 $ );
glEnd();
}
\fP
.RE
.fi
.P
And finally, if \f2mode\fP is \%\f3GL_POINT\fP, then a call to
\%\f3glEvalMesh2\fP is equivalent to:
.nf
.IP
\f7
glBegin( GL_POINTS );
for ( j = \f2j1\fP; j <= \f2j2\fP; j += 1 )
for ( i = \f2i1\fP; i <= \f2i2\fP; i += 1 )
glEvalCoord2( i$^cdot^DELTA u ~+~ u sub 1$, j$^cdot^DELTA v ~+~ v sub 1$ );
glEnd();
\fP
.RE
.fi
.P
In all three cases, the only absolute numeric requirements are that if $i~=~n$,
then the value computed from $i^cdot^DELTA u ~+~ u sub 1$ is exactly $u
sub 2$, and if $j~=~m$, then the value computed from
$j ^cdot^ DELTA v ~+~ v sub 1$ is exactly $v sub 2$.
.SH ERRORS
\%\f3GL_INVALID_ENUM\fP is generated if \f2mode\fP is not an accepted value.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glEvalMesh\fP
is executed between the execution of \%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.SH ASSOCIATED GETS
\%\f3glGet\fP with argument \%\f3GL_MAP1_GRID_DOMAIN\fP
.br
\%\f3glGet\fP with argument \%\f3GL_MAP2_GRID_DOMAIN\fP
.br
\%\f3glGet\fP with argument \%\f3GL_MAP1_GRID_SEGMENTS\fP
.br
\%\f3glGet\fP with argument \%\f3GL_MAP2_GRID_SEGMENTS\fP
.SH SEE ALSO
\%\f3glBegin(3G)\fP,
\%\f3glEvalCoord(3G)\fP,
\%\f3glEvalPoint(3G)\fP,
\%\f3glMap1(3G)\fP,
\%\f3glMap2(3G)\fP,
\%\f3glMapGrid(3G)\fP
|