'\"! eqn | mmdoc '\"macro stdmacro .ds Vn Version 1.2 .ds Dt 6 March 1997 .ds Re Release 1.1.0 .ds Dp Mar 17 18:05 .ds Dm Mar 6 20:0 .ds Xs 23206 10 evalmesh.gl .TH GLEVALMESH .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 glBegin (\f2type\fP); for (i = \f2i1\fP; i <= \f2i2\fP; i += 1) glEvalCoord1(i . DELTA u + u sub 1) glEnd(); .P .fi where .sp .nf DELTA u = (u - u ) / 1 2 1 .fi .sp .nf and n, u, and u are the arguments to the most recent 1 2 .br .fi \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 .nf i . DELTA u + u is exactly u. .fi 1 2 .P In the two-dimensional case, \f3glEvalMesh2\fP, let .sp .nf DELTA u = (u - u )/n 2 1 DELTA v = (v - v )/m, 2 1 where n, u , u , m, v , and v 1 2 1 2 .fi 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 for (j = \f2j1\fP; j < \f2j2\fP; j += 1) { glBegin (GL_QUAD_STRIP); for (i = \f2i1\fP; i <= \f2i2\fP; i += 1) { glEvalCoord2(i . DELTA u + u , j . DELTA v + v ); 1 1 glEvalCoord2(i . DELTA u + u , (j+1) . DELTA v + v ); 1 1 } glEnd(); } .fi .P If \f2mode\fP is \f3GL_LINE\fP, then a call to \f3glEvalMesh2\fP is equivalent to: .nf for (j = \f2j1\fP; j <= \f2j2\fP; j += 1) { glBegin(GL_LINE_STRIP); for (i = \f2i1\fP; i <= \f2i2\fP; i += 1) glEvalCoord2(i . DELTA u + u , j . DELTA v + v ); 1 1 glEnd(); } for (i = \f2i1\fP; i <= \f2i2\fP; i += 1) { glBegin(GL_LINE_STRIP); for (j = \f2j1\fP; j <= \f2j1\fP; j += 1) glEvalCoord2)(i . DELTA u + u , j . DELTA v + v ); 1 1 glEnd(); } .fi .P And finally, if \f2mode\fP is \f3GL_POINT\fP, then a call to \f3glEvalMesh2\fP is equivalent to: .nf glBegin (GL_POINTS); for (j = \f2j1\fP; j <= \f2j2\fP; j += 1) { for (i = \f2i1\fP; i <= \f2i2\fP; i += 1) { glEvalCoord2(i . DELTA u + u , j . DELTA v + v ); 1 1 } } glEnd(); .fi .P In all three cases, the only absolute numeric requirements are that if $i~=~n$, then the value computed from .nf i . DELTA u + u is exactly u , 1 2 and if $j~=~m$, then the value computed from j . DELTA v + v is exactly v . 1 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\fP, \f3glEvalCoord\fP, \f3glEvalPoint\fP, \f3glMap1\fP, \f3glMap2\fP, \f3glMapGrid\fP