Computes a one-dimensional (1D) or two-dimensional (2D) grid of points or lines.

OpenGL C bindings library: **libGL.a**

void glEvalMesh1(GLenumMode,GLinti1,GLinti2)

void glEvalMesh2(GLenumMode,GLinti1,GLinti2,GLintj1,GLintj2)

The **glMapGrid** and **glEvalMesh** subroutines are used in tandem to efficiently generate and evaluate a series of evenly spaced map domain values. The **glEvalMesh** subroutine steps through the integer domain of a 1D or 2D grid whose range is the domain of the evaluation maps specified by **glMap1** and **glMap2**. The *Mode* parameter determines whether the resulting vertices are connected as points, lines, or filled polygons.

In the 1D case, **glEvalMesh1**, the mesh is generated as if the following code fragment was executed:

glBegin(Type); for (i = i1; i <= i2; i += 1) glEvalCoord1(i (DELTA u) + u1) glEnd();

where DELTA *u* = (*u*2 - *u*1 )/*n* and *n*, *u*1, and *u*2 are the arguments to the most recent **glMapGrid1** subroutine. *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*, the value computed from *i *(DELTA *u*) + *u*1 is exactly *u*2.

In the 2D case,** glEvalMesh2**, DELTA *u* = (*u*2 - *u*1)/*n* and DELTA *v* = (*v*2 - *v*1)/*m*, where *n*, *u*1, *u*2, *m*, *v*1, and *v*2 are the arguments to the most recent **glMapGrid2** subroutine. Then, if *Mode* is **GL_FILL**, the **glEvalMesh2** subroutine is equivalent to:

for (j = j1; j < j2; j += 1) { glBegin(GL_QUAD_STRIP) for (i= i1; i <= i2; i += 1) { glEvalCoord2(i (DELTA u) + u1, j (DELTA v) + v1); glEvalCoord2(i (DELTA u) + u1, (j+1) (DELTA v) + v1); } glEnd(); }

If *Mode* is **GL_LINE**, a call to **glEvalMesh2** is equivalent to:

for (j = j1; j <= j2; j += 1) { glBegin(GL_LINE_STRIP) for (i = i1; i <= i2; i += 1) glEvalCoord2(i DELTA u + u1, j (DELTA v) + v1); glEnd(); } for (i = i1; i <= i2; i += 1) { glBegin(GL_LINE_STRIP); for (j = j1; j <= j1; j += 1) glEvalCoord2(i (DELTA u + u1, j (DELTA v) + v1); glEnd(); }

And finally, if *Mode* is **GL_POINT**, a call to **glEvalMesh2** is equivalent to:

glBegin(GL_POINTS); for (j = j1; j <= j2; j += 1) { for (i = i1; i <= i2; i += 1) { glEvalCoord2(i (DELTA u) + u1, j (DELTA v) + v1): } } glEnd();

In all three cases, the only absolute numeric requirements are that if *i *= *n*, the value computed from *i* (DELTA *u*) + *u*1 is exactly *u*2, and if *j *= *m*, the value computed from *j* (DELTA *v*) + *v*1 is exactly *v*2.

GL_INVALID_ENUM |
Indicates that Mode is not an accepted value. |

GL_INVALID_OPERATION |
Indicates that glEvalMesh is called between a call to glBegin and the corresponding call to glEnd. |

Associated gets for the **glEvalMesh **subroutine are as follows. (See the **glGet** subroutine for more information.)

**glGet** with argument **GL_MAP1_GRID_DOMAIN**

**glGet** with argument **GL_MAP2_GRID_DOMAIN**

**glGet** with argument **GL_MAP1_GRID_SEGMENTS**

**glGet** with argument **GL_MAP2_GRID_SEGMENTS**.

/usr/include/GL/gl.h |
Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. |

The **glBegin** or **glEnd** subroutine, **glEvalCoord** subroutine, **glEvalPoint** subroutine, **glMap1** subroutine, **glMap2** subroutine, **glMapGrid** subroutine.