1GLMAP2(3G) OpenGL Manual GLMAP2(3G)
2
3
4
6 glMap2 - define a two-dimensional evaluator
7
9 void glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride,
10 GLint uorder, GLfloat v1, GLfloat v2, GLint vstride,
11 GLint vorder, const GLfloat * points);
12
13 void glMap2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride,
14 GLint uorder, GLdouble v1, GLdouble v2, GLint vstride,
15 GLint vorder, const GLdouble * points);
16
18 target
19 Specifies the kind of values that are generated by the evaluator.
20 Symbolic constants GL_MAP2_VERTEX_3, GL_MAP2_VERTEX_4,
21 GL_MAP2_INDEX, GL_MAP2_COLOR_4, GL_MAP2_NORMAL,
22 GL_MAP2_TEXTURE_COORD_1, GL_MAP2_TEXTURE_COORD_2,
23 GL_MAP2_TEXTURE_COORD_3, and GL_MAP2_TEXTURE_COORD_4 are accepted.
24
25 u1, u2
26 Specify a linear mapping of u, as presented to glEvalCoord2(), to
27 u^, one of the two variables that are evaluated by the equations
28 specified by this command. Initially, u1 is 0 and u2 is 1.
29
30 ustride
31 Specifies the number of floats or doubles between the beginning of
32 control point R ij and the beginning of control point R i + 1 j,
33 where i and j are the u and v control point indices, respectively.
34 This allows control points to be embedded in arbitrary data
35 structures. The only constraint is that the values for a particular
36 control point must occupy contiguous memory locations. The initial
37 value of ustride is 0.
38
39 uorder
40 Specifies the dimension of the control point array in the u axis.
41 Must be positive. The initial value is 1.
42
43 v1, v2
44 Specify a linear mapping of v, as presented to glEvalCoord2(), to
45 v^, one of the two variables that are evaluated by the equations
46 specified by this command. Initially, v1 is 0 and v2 is 1.
47
48 vstride
49 Specifies the number of floats or doubles between the beginning of
50 control point R ij and the beginning of control point R i j + 1,
51 where i and j are the u and v control point indices, respectively.
52 This allows control points to be embedded in arbitrary data
53 structures. The only constraint is that the values for a particular
54 control point must occupy contiguous memory locations. The initial
55 value of vstride is 0.
56
57 vorder
58 Specifies the dimension of the control point array in the v axis.
59 Must be positive. The initial value is 1.
60
61 points
62 Specifies a pointer to the array of control points.
63
65 Evaluators provide a way to use polynomial or rational polynomial
66 mapping to produce vertices, normals, texture coordinates, and colors.
67 The values produced by an evaluator are sent on to further stages of GL
68 processing just as if they had been presented using glVertex(),
69 glNormal(), glTexCoord(), and glColor() commands, except that the
70 generated values do not update the current normal, texture coordinates,
71 or color.
72
73 All polynomial or rational polynomial splines of any degree (up to the
74 maximum degree supported by the GL implementation) can be described
75 using evaluators. These include almost all surfaces used in computer
76 graphics, including B-spline surfaces, NURBS surfaces, Bezier surfaces,
77 and so on.
78
79 Evaluators define surfaces based on bivariate Bernstein polynomials.
80 Define p u^ v^ as
81
82 p u^ v^ = Σ i = 0 n Σ j = 0 m B i n u^ B j m v^ R ij
83
84 where R ij is a control point, B i n u^ is the ith Bernstein
85 polynomial of degree n (uorder = n + 1)
86
87 B i n u^ = n i u^ i 1 - u^ n - i
88
89 and B j m v^ is the jth Bernstein polynomial of degree m (vorder = m
90 + 1)
91
92 B j m v^ = m j v^ j 1 - v^ m - j
93
94 Recall that 0 0 == 1 and n 0 == 1
95
96 glMap2 is used to define the basis and to specify what kind of values
97 are produced. Once defined, a map can be enabled and disabled by
98 calling glEnable() and glDisable() with the map name, one of the nine
99 predefined values for target, described below. When glEvalCoord2()
100 presents values u and v, the bivariate Bernstein polynomials are
101 evaluated using u^ and v^, where
102
103 u^ = u - u1 u2 - u1
104
105 v^ = v - v1 v2 - v1
106
107 target is a symbolic constant that indicates what kind of control
108 points are provided in points, and what output is generated when the
109 map is evaluated. It can assume one of nine predefined values:
110
111 GL_MAP2_VERTEX_3
112 Each control point is three floating-point values representing x,
113 y, and z. Internal glVertex3() commands are generated when the map
114 is evaluated.
115
116 GL_MAP2_VERTEX_4
117 Each control point is four floating-point values representing x, y,
118 z, and w. Internal glVertex4() commands are generated when the map
119 is evaluated.
120
121 GL_MAP2_INDEX
122 Each control point is a single floating-point value representing a
123 color index. Internal glIndex() commands are generated when the map
124 is evaluated but the current index is not updated with the value of
125 these glIndex() commands.
126
127 GL_MAP2_COLOR_4
128 Each control point is four floating-point values representing red,
129 green, blue, and alpha. Internal glColor4() commands are generated
130 when the map is evaluated but the current color is not updated with
131 the value of these glColor4() commands.
132
133 GL_MAP2_NORMAL
134 Each control point is three floating-point values representing the
135 x, y, and z components of a normal vector. Internal glNormal()
136 commands are generated when the map is evaluated but the current
137 normal is not updated with the value of these glNormal() commands.
138
139 GL_MAP2_TEXTURE_COORD_1
140 Each control point is a single floating-point value representing
141 the s texture coordinate. Internal glTexCoord1() commands are
142 generated when the map is evaluated but the current texture
143 coordinates are not updated with the value of these glTexCoord()
144 commands.
145
146 GL_MAP2_TEXTURE_COORD_2
147 Each control point is two floating-point values representing the s
148 and t texture coordinates. Internal glTexCoord2() commands are
149 generated when the map is evaluated but the current texture
150 coordinates are not updated with the value of these glTexCoord()
151 commands.
152
153 GL_MAP2_TEXTURE_COORD_3
154 Each control point is three floating-point values representing the
155 s, t, and r texture coordinates. Internal glTexCoord3() commands
156 are generated when the map is evaluated but the current texture
157 coordinates are not updated with the value of these glTexCoord()
158 commands.
159
160 GL_MAP2_TEXTURE_COORD_4
161 Each control point is four floating-point values representing the
162 s, t, r, and q texture coordinates. Internal glTexCoord4() commands
163 are generated when the map is evaluated but the current texture
164 coordinates are not updated with the value of these glTexCoord()
165 commands.
166
167 ustride, uorder, vstride, vorder, and points define the array
168 addressing for accessing the control points. points is the location of
169 the first control point, which occupies one, two, three, or four
170 contiguous memory locations, depending on which map is being defined.
171 There are uorder × vorder control points in the array. ustride
172 specifies how many float or double locations are skipped to advance the
173 internal memory pointer from control point R i j to control point R i
174 + 1 j. vstride specifies how many float or double locations are
175 skipped to advance the internal memory pointer from control point R i
176 j to control point R i j + 1.
177
179 As is the case with all GL commands that accept pointers to data, it is
180 as if the contents of points were copied by glMap2 before glMap2
181 returns. Changes to the contents of points have no effect after glMap2
182 is called.
183
184 Initially, GL_AUTO_NORMAL is enabled. If GL_AUTO_NORMAL is enabled,
185 normal vectors are generated when either GL_MAP2_VERTEX_3 or
186 GL_MAP2_VERTEX_4 is used to generate vertices.
187
189 GL_INVALID_ENUM is generated if target is not an accepted value.
190
191 GL_INVALID_VALUE is generated if u1 is equal to u2, or if v1 is equal
192 to v2.
193
194 GL_INVALID_VALUE is generated if either ustride or vstride is less than
195 the number of values in a control point.
196
197 GL_INVALID_VALUE is generated if either uorder or vorder is less than 1
198 or greater than the return value of GL_MAX_EVAL_ORDER.
199
200 GL_INVALID_OPERATION is generated if glMap2 is executed between the
201 execution of glBegin() and the corresponding execution of glEnd().
202
203 GL_INVALID_OPERATION is generated if glMap2 is called and the value of
204 GL_ACTIVE_TEXTURE is not GL_TEXTURE0.
205
207 glGetMap()
208
209 glGet() with argument GL_MAX_EVAL_ORDER
210
211 glIsEnabled() with argument GL_MAP2_VERTEX_3
212
213 glIsEnabled() with argument GL_MAP2_VERTEX_4
214
215 glIsEnabled() with argument GL_MAP2_INDEX
216
217 glIsEnabled() with argument GL_MAP2_COLOR_4
218
219 glIsEnabled() with argument GL_MAP2_NORMAL
220
221 glIsEnabled() with argument GL_MAP2_TEXTURE_COORD_1
222
223 glIsEnabled() with argument GL_MAP2_TEXTURE_COORD_2
224
225 glIsEnabled() with argument GL_MAP2_TEXTURE_COORD_3
226
227 glIsEnabled() with argument GL_MAP2_TEXTURE_COORD_4
228
230 glBegin(), glColor(), glEnable(), glEvalCoord(), glEvalMesh(),
231 glEvalPoint(), glMap1(), glMapGrid(), glNormal(), glTexCoord(),
232 glVertex()
233
235 Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
236 under the SGI Free Software B License. For details, see
237 http://oss.sgi.com/projects/FreeB/.
238
240 opengl.org
241
242
243
244opengl.org 06/10/2014 GLMAP2(3G)