Method GL.glEvalMesh2()
- Method
glEvalMesh2
voidglEvalMesh2(intmode,inti1,inti2,intj1,intj2)- Description
glMapGridand glEvalMesh1 and glEvalMesh2 are used in tandem to efficiently generate and evaluate a series of evenly-spaced map domain values. glEvalMesh1 and glEvalMesh2 steps through the integer domain of a one- or two-dimensional grid, whose range is the domain of the evaluation maps specified byglMap1andglMap2. mode determines whether the resulting vertices are connected as points, lines, or filled polygons.In the one-dimensional case, glEvalMesh1, the mesh is generated as if the following code fragment were executed: .nf
glBegin (type); for (i = i1; i <= i2; i += 1) glEvalCoord1(i . DELTA u + u sub 1) glEnd();
.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
.fi
glMapGrid1command. type is GL_POINTS if mode is GL_POINT, or GL_LINES if mode is GL_LINE.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
In the two-dimensional case, glEvalMesh2, 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
glMapGrid2command. Then, if mode is GL_FILL, the glEvalMesh2 command is equivalent to: .nffor (j = j1; j < j2; j += 1) { glBegin (GL_QUAD_STRIP); for (i = i1; i <= i2; 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
If mode is GL_LINE, then a call to glEvalMesh2 is equivalent to: .nf
for (j = j1; j <= j2; j += 1) { glBegin(GL_LINE_STRIP); for (i = i1; i <= i2; i += 1) glEvalCoord2(i . DELTA u + u , j . DELTA v + v ); 1 1 glEnd(); } for (i = i1; i <= i2; i += 1) { glBegin(GL_LINE_STRIP); for (j = j1; j <= j1; j += 1) glEvalCoord2)(i . DELTA u + u , j . DELTA v + v ); 1 1 glEnd(); }
.fi
And finally, if mode is GL_POINT, then a call to glEvalMesh2 is equivalent to: .nf
glBegin (GL_POINTS); for (j = j1; j <= j2; j += 1) { for (i = i1; i <= i2; i += 1) { glEvalCoord2(i . DELTA u + u , j . DELTA v + v ); 1 1 } } glEnd(); .fi
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
- Parameter
mode In glEvalMesh1, specifies whether to compute a one-dimensional mesh of points or lines. Symbolic constants GL_POINT and GL_LINE are accepted.
- Parameter
i1 Specify the first and last integer values for grid domain variable i.
- Parameter
mode In glEvalMesh2, specifies whether to compute a two-dimensional mesh of points, lines, or polygons. Symbolic constants GL_POINT, GL_LINE, and GL_FILL are accepted.
- Parameter
i1 Specify the first and last integer values for grid domain variable i.
- Parameter
j1 Specify the first and last integer values for grid domain variable j.
- Throws
GL_INVALID_ENUM is generated if mode is not an accepted value.
GL_INVALID_OPERATION is generated if glEvalMesh1 and glEvalMesh2 is executed between the execution of glBegin and the corresponding execution of glEnd.