1GLEVALMESH(3G) GLEVALMESH(3G)
2
3
4
6 glEvalMesh1, glEvalMesh2 - compute a one- or two-dimensional grid of
7 points or lines
8
9
11 void glEvalMesh1( GLenum mode,
12 GLint i1,
13 GLint i2 )
14
15
17 mode In glEvalMesh1, specifies whether to compute a one-dimensional
18 mesh of points or lines. Symbolic constants GL_POINT and GL_LINE
19 are accepted.
20
21 i1, i2
22 Specify the first and last integer values for grid domain vari‐
23 able i.
24
26 void glEvalMesh2( GLenum mode,
27 GLint i1,
28 GLint i2,
29 GLint j1,
30 GLint j2 )
31
32
34 mode In glEvalMesh2, specifies whether to compute a two-dimensional
35 mesh of points, lines, or polygons. Symbolic constants
36 GL_POINT, GL_LINE, and GL_FILL are accepted.
37
38 i1, i2 Specify the first and last integer values for grid domain vari‐
39 able i.
40
41 j1, j2 Specify the first and last integer values for grid domain vari‐
42 able j.
43
45 glMapGrid and glEvalMesh are used in tandem to efficiently generate and
46 evaluate a series of evenly-spaced map domain values. glEvalMesh steps
47 through the integer domain of a one- or two-dimensional grid, whose
48 range is the domain of the evaluation maps specified by glMap1 and
49 glMap2. mode determines whether the resulting vertices are connected
50 as points, lines, or filled polygons.
51
52 In the one-dimensional case, glEvalMesh1, the mesh is generated as if
53 the following code fragment were executed:
54
55 glBegin( type );
56 for ( i = i1; i <= i2; i += 1 )
57 glEvalCoord1( i⋅Δu+u1 );
58 glEnd();
60
61 Δu=(u2−u1)/n
62
63
64and n, u1, and u2 are the arguments to the most recent glMapGrid1 command.
66
67The one absolute numeric requirement is that if i=n, then the value computed
68from i⋅Δu+u1 is exactly u2.
69
70In the two-dimensional case, glEvalMesh2, let
71
72 Δu=(u2−u1)/n
73
74 Δv=(v2−v1)/m,
75
76where n, u1, u2, m, v1, and v2 are the arguments to the most recent glMapGrid2
77command. Then, if mode is GL_FILL, the glEvalMesh2 command is equivalent to:
78
79 for ( j = j1; j < j2; j += 1 ) {
80 glBegin( GL_QUAD_STRIP );
81 for ( i = i1; i <= i2; i += 1 ) {
82 glEvalCoord2( i⋅Δu+u1, j⋅Δv+v1 );
83 glEvalCoord2( i⋅Δu+u1, (j+1)⋅Δv+v1 );
84 }
85 glEnd();
86 }
87
88If mode is GL_LINE, then a call to glEvalMesh2 is equivalent to:
89
90 for ( j = j1; j <= j2; j += 1 ) {
91 glBegin( GL_LINE_STRIP );
92 for ( i = i1; i <= i2; i += 1 )
93 glEvalCoord2( i⋅Δu+u1, j⋅Δv+v1 );
94 glEnd();
95 }
96
97 for ( i = i1; i <= i2; i += 1 ) {
98 glBegin( GL_LINE_STRIP );
99 for ( j = j1; j <= j1; j += 1 )
100 glEvalCoord2( i⋅Δu+u1, j⋅Δv+v1 );
101 glEnd();
102 }
103
104And finally, if mode is GL_POINT, then a call to glEvalMesh2 is equivalent to:
105
106 glBegin( GL_POINTS );
107 for ( j = j1; j <= j2; j += 1 )
108 for ( i = i1; i <= i2; i += 1 )
109 glEvalCoord2( i⋅Δu+u1, j⋅Δv+v1 );
110 glEnd();
111
112In all three cases, the only absolute numeric requirements are that if i=n,
113then the value computed from i⋅Δu+u1 is exactly u2, and if j=m, then the value
114computed from j⋅Δv+v1 is exactly v2.
115
117 GL_INVALID_ENUM is generated if mode is not an accepted value.
118
119 GL_INVALID_OPERATION is generated if glEvalMesh is executed between the
120 execution of glBegin and the corresponding execution of glEnd.
121
123 glGet with argument GL_MAP1_GRID_DOMAIN
124 glGet with argument GL_MAP2_GRID_DOMAIN
125 glGet with argument GL_MAP1_GRID_SEGMENTS
126 glGet with argument GL_MAP2_GRID_SEGMENTS
127
129 glBegin(3G), glEvalCoord(3G), glEvalPoint(3G), glMap1(3G), glMap2(3G),
130 glMapGrid(3G)
131
132
133
134 GLEVALMESH(3G)