1GLEVALMESH(3G) OpenGL Manual GLEVALMESH(3G)
2
3
4
6 glEvalMesh - compute a one- or two-dimensional grid of points or lines
7
9 void glEvalMesh1(GLenum mode, GLint i1, GLint i2);
10
12 mode
13 In glEvalMesh1, specifies whether to compute a one-dimensional mesh
14 of points or lines. Symbolic constants GL_POINT and GL_LINE are
15 accepted.
16
17 i1, i2
18 Specify the first and last integer values for grid domain variable
19 i.
20
22 void glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
23
25 mode
26 In glEvalMesh2, specifies whether to compute a two-dimensional mesh
27 of points, lines, or polygons. Symbolic constants GL_POINT,
28 GL_LINE, and GL_FILL are accepted.
29
30 i1, i2
31 Specify the first and last integer values for grid domain variable
32 i.
33
34 j1, j2
35 Specify the first and last integer values for grid domain variable
36 j.
37
39 glMapGrid() and glEvalMesh are used in tandem to efficiently generate
40 and evaluate a series of evenly-spaced map domain values. glEvalMesh
41 steps through the integer domain of a one- or two-dimensional grid,
42 whose range is the domain of the evaluation maps specified by glMap1()
43 and glMap2(). mode determines whether the resulting vertices are
44 connected as points, lines, or filled polygons.
45
46 In the one-dimensional case, glEvalMesh1, the mesh is generated as if
47 the following code fragment were executed:
48
49 glBegin( type );
50 for ( i = i1; i <= i2; i += 1 )
51 glEvalCoord1(
52
53
54
55 i
56 ⋅
57 Δ
58 u
59
60 +
61
62 u
63 1
64
65
66 );
67 glEnd();
68
69
70 where
71
72 Δ u = u 2 - u 1 n
73
74 and n, u 1, and u 2 are the arguments to the most recent glMapGrid1()
75 command. type is GL_POINTS if mode is GL_POINT, or GL_LINES if mode is
76 GL_LINE.
77
78 The one absolute numeric requirement is that if i = n, then the value
79 computed from i ⋅ Δ u + u 1 is exactly u 2.
80
81 In the two-dimensional case, glEvalMesh2, let .cp Δ u = u 2 - u 1 n
82
83 Δ v = v 2 - v 1 m
84
85 where n, u 1, u 2, m, v 1, and v 2 are the arguments to the most recent
86 glMapGrid2() command. Then, if mode is GL_FILL, the glEvalMesh2 command
87 is equivalent to:
88
89 for ( j = j1; j < j2; j += 1 ) {
90 glBegin( GL_QUAD_STRIP );
91 for ( i = i1; i <= i2; i += 1 ) {
92 glEvalCoord2(
93
94
95
96 i
97 ⋅
98 Δ
99 u
100
101 +
102
103 u
104 1
105
106 ,
107
108
109 j
110 ⋅
111 Δ
112 v
113
114
115 +
116
117 v
118 1
119
120
121 );
122 glEvalCoord2(
123
124
125
126 i
127 ⋅
128 Δ
129 u
130
131 +
132
133 u
134 1
135
136 ,
137
138
139
140
141
142 j
143 +
144 1
145
146
147
148 ⋅
149 Δ
150 v
151
152 +
153
154 v
155 1
156
157
158 );
159 }
160 glEnd();
161 }
162
163
164 If mode is GL_LINE, then a call to glEvalMesh2 is equivalent to:
165
166 for ( j = j1; j <= j2; j += 1 ) {
167 glBegin( GL_LINE_STRIP );
168 for ( i = i1; i <= i2; i += 1 )
169 glEvalCoord2(
170
171
172
173 i
174 ⋅
175 Δ
176 u
177
178 +
179
180 u
181 1
182
183 ,
184
185
186 j
187 ⋅
188 Δ
189 v
190
191 +
192
193 v
194 1
195
196
197 );
198 glEnd();
199 }
200
201 for ( i = i1; i <= i2; i += 1 ) {
202 glBegin( GL_LINE_STRIP );
203 for ( j = j1; j <= j1; j += 1 )
204 glEvalCoord2(
205
206
207
208 i
209 ⋅
210 Δ
211 u
212
213 +
214
215 u
216 1
217
218 ,
219
220
221 j
222 ⋅
223 Δ
224 v
225
226 +
227
228 v
229 1
230
231
232 );
233 glEnd();
234 }
235
236
237 And finally, if mode is GL_POINT, then a call to glEvalMesh2 is
238 equivalent to:
239
240 glBegin( GL_POINTS );
241 for ( j = j1; j <= j2; j += 1 )
242 for ( i = i1; i <= i2; i += 1 )
243 glEvalCoord2(
244
245
246
247 i
248 ⋅
249 Δ
250 u
251
252 +
253
254 u
255 1
256
257 ,
258
259
260 j
261 ⋅
262 Δ
263 v
264
265 +
266
267 v
268 1
269
270
271 );
272 glEnd();
273
274
275 In all three cases, the only absolute numeric requirements are that if
276 i = n, then the value computed from i ⋅ Δ u + u 1 is exactly u 2, and
277 if j = m, then the value computed from j ⋅ Δ v + v 1 is exactly v 2.
278
280 GL_INVALID_ENUM is generated if mode is not an accepted value.
281
282 GL_INVALID_OPERATION is generated if glEvalMesh is executed between the
283 execution of glBegin() and the corresponding execution of glEnd().
284
286 glGet() with argument GL_MAP1_GRID_DOMAIN
287
288 glGet() with argument GL_MAP2_GRID_DOMAIN
289
290 glGet() with argument GL_MAP1_GRID_SEGMENTS
291
292 glGet() with argument GL_MAP2_GRID_SEGMENTS
293
295 glBegin(), glEvalCoord(), glEvalPoint(), glMap1(), glMap2(),
296 glMapGrid()
297
299 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
300 under the SGI Free Software B License. For details, see
301 http://oss.sgi.com/projects/FreeB/.
302
304 opengl.org
305
306
307
308opengl.org 06/10/2014 GLEVALMESH(3G)