1GLMAP1(3G)                                                          GLMAP1(3G)
2
3
4

NAME

6       glMap1d, glMap1f - define a one-dimensional evaluator
7
8

C SPECIFICATION

10       void glMap1d( GLenum target,
11                     GLdouble u1,
12                     GLdouble u2,
13                     GLint stride,
14                     GLint order,
15                     const GLdouble *points )
16       void glMap1f( GLenum target,
17                     GLfloat u1,
18                     GLfloat u2,
19                     GLint stride,
20                     GLint order,
21                     const GLfloat *points )
22
23

PARAMETERS

25       target  Specifies  the kind of values that are generated by the evalua‐
26               tor.  Symbolic  constants  GL_MAP1_VERTEX_3,  GL_MAP1_VERTEX_4,
27               GL_MAP1_INDEX,         GL_MAP1_COLOR_4,         GL_MAP1_NORMAL,
28               GL_MAP1_TEXTURE_COORD_1,               GL_MAP1_TEXTURE_COORD_2,
29               GL_MAP1_TEXTURE_COORD_3,    and   GL_MAP1_TEXTURE_COORD_4   are
30               accepted.
31
32       u1, u2  Specify a linear mapping of u, as presented to glEvalCoord1, to
33               ^u, the variable that is evaluated by the equations specified by
34               this command.
35
36       stride  Specifies the number of floats or doubles between the beginning
37               of  one  control point and the beginning of the next one in the
38               data structure  referenced  in  points.   This  allows  control
39               points  to  be embedded in arbitrary data structures.  The only
40               constraint is that the values for a  particular  control  point
41               must occupy contiguous memory locations.
42
43       order   Specifies the number of control points.  Must be positive.
44
45       points  Specifies a pointer to the array of control points.
46
47

DESCRIPTION

49       Evaluators  provide a way to use polynomial or rational polynomial map‐
50       ping to produce vertices, normals,  texture  coordinates,  and  colors.
51       The  values  produced  by an evaluator are sent to further stages of GL
52       processing just as if they had been presented using glVertex, glNormal,
53       glTexCoord,  and  glColor commands, except that the generated values do
54       not update the current normal, texture coordinates, or color.
55
56       All polynomial or rational polynomial splines of any degree (up to  the
57       maximum  degree  supported  by  the GL implementation) can be described
58       using evaluators.  These include almost all splines  used  in  computer
59       graphics: B-splines, Bezier curves, Hermite splines, and so on.
60
61       Evaluators  define  curves based on Bernstein polynomials.  Define p(^u)
62       as
63
64                                   p(^u)=in=Σ0Bni(^u)Ri
65
66       where Ri is a control point and Bni(^u) is the ith  Bernstein  polynomial
67       of degree n (order = n+1):
68
69                                 Bni(^u)=⎛⎝n⎞⎠^ui(1−^u)ni
70                                        i
71       Recall that
72
73                                   00≡1 and ⎛⎝n⎞⎠≡1
74                                             0
75       glMap1  is  used to define the basis and to specify what kind of values
76       are produced.  Once defined, a map can be enabled and disabled by call‐
77       ing  glEnable  and  glDisable with the map name, one of the nine prede‐
78       fined values for target described below.   glEvalCoord1  evaluates  the
79       one-dimensional maps that are enabled.  When
80       glEvalCoord1  presents a value u, the Bernstein functions are evaluated
81       using ^u, where
82
83                                       ^u=u_u2_−−_uu_11_
84
85
86       target is a symbolic constant  that  indicates  what  kind  of  control
87       points  are  provided  in points, and what output is generated when the
88       map is evaluated.  It can assume one of nine predefined values:
89
90       GL_MAP1_VERTEX_3         Each control  point  is  three  floating-point
91                                values  representing  x,  y,  and z.  Internal
92                                glVertex3 commands are generated when the  map
93                                is evaluated.
94
95       GL_MAP1_VERTEX_4         Each control point is four floating-point val‐
96                                ues representing x, y,  z,  and  w.   Internal
97                                glVertex4  commands are generated when the map
98                                is evaluated.
99
100       GL_MAP1_INDEX            Each control point is a single  floating-point
101                                value  representing  a  color index.  Internal
102                                glIndex commands are generated when the map is
103                                evaluated but the current index is not updated
104                                with the value of these glIndex commands.
105
106       GL_MAP1_COLOR_4          Each control point is four floating-point val‐
107                                ues  representing red, green, blue, and alpha.
108                                Internal glColor4 commands are generated  when
109                                the  map is evaluated but the current color is
110                                not updated with the value of  these  glColor4
111                                commands.
112
113       GL_MAP1_NORMAL           Each  control  point  is  three floating-point
114                                values representing the x, y, and z components
115                                of  a  normal  vector.  Internal glNormal com‐
116                                mands are generated when the map is  evaluated
117                                but the current normal is not updated with the
118                                value of these glNormal commands.
119
120       GL_MAP1_TEXTURE_COORD_1  Each control point is a single  floating-point
121                                value  representing  the s texture coordinate.
122                                Internal
123                                glTexCoord1 commands are  generated  when  the
124                                map is evaluated but the current texture coor‐
125                                dinates are not  updated  with  the  value  of
126                                these glTexCoord commands.
127
128       GL_MAP1_TEXTURE_COORD_2  Each  control point is two floating-point val‐
129                                ues representing the s and t  texture  coordi‐
130                                nates.  Internal
131                                glTexCoord2  commands  are  generated when the
132                                map is evaluated but the current texture coor‐
133                                dinates  are  not  updated  with  the value of
134                                these glTexCoord commands.
135
136       GL_MAP1_TEXTURE_COORD_3  Each control  point  is  three  floating-point
137                                values  representing  the  s, t, and r texture
138                                coordinates.   Internal  glTexCoord3  commands
139                                are  generated  when  the map is evaluated but
140                                the  current  texture  coordinates   are   not
141                                updated  with  the  value  of these glTexCoord
142                                commands.
143
144       GL_MAP1_TEXTURE_COORD_4  Each control point is four floating-point val‐
145                                ues  representing  the  s, t, r, and q texture
146                                coordinates.  Internal
147                                glTexCoord4 commands are  generated  when  the
148                                map is evaluated but the current texture coor‐
149                                dinates are not  updated  with  the  value  of
150                                these glTexCoord commands.
151
152       stride, order, and points define the array addressing for accessing the
153       control points.  points is the location of  the  first  control  point,
154       which  occupies  one,  two, three, or four contiguous memory locations,
155       depending on which map is being defined.  order is the number  of  con‐
156       trol  points  in  the array.  stride specifies how many float or double
157       locations to advance the internal memory pointer to reach the next con‐
158       trol point.
159

NOTES

161       As is the case with all GL commands that accept pointers to data, it is
162       as if the contents of  points  were  copied  by  glMap1  before  glMap1
163       returns.  Changes to the contents of points have no effect after glMap1
164       is called.
165

ERRORS

167       GL_INVALID_ENUM is generated if target is not an accepted value.
168
169       GL_INVALID_VALUE is generated if u1 is equal to u2.
170
171       GL_INVALID_VALUE is generated if stride is less than the number of val‐
172       ues in a control point.
173
174       GL_INVALID_VALUE  is  generated if order is less than 1 or greater than
175       the return value of GL_MAX_EVAL_ORDER.
176
177       GL_INVALID_OPERATION is generated if glMap1  is  executed  between  the
178       execution of glBegin and the corresponding execution of glEnd.
179
180       When     the     GL_ARB_multitexture     extension     is    supported,
181       GL_INVALID_OPERATION is generated if glMap1 is called and the value  of
182       GL_ACTIVE_TEXTURE_ARB is not GL_TEXTURE0_ARB.
183

ASSOCIATED GETS

185       glGetMap
186       glGet with argument GL_MAX_EVAL_ORDER
187       glIsEnabled with argument GL_MAP1_VERTEX_3
188       glIsEnabled with argument GL_MAP1_VERTEX_4
189       glIsEnabled with argument GL_MAP1_INDEX
190       glIsEnabled with argument GL_MAP1_COLOR_4
191       glIsEnabled with argument GL_MAP1_NORMAL
192       glIsEnabled with argument GL_MAP1_TEXTURE_COORD_1
193       glIsEnabled with argument GL_MAP1_TEXTURE_COORD_2
194       glIsEnabled with argument GL_MAP1_TEXTURE_COORD_3
195       glIsEnabled with argument GL_MAP1_TEXTURE_COORD_4
196

SEE ALSO

198       glBegin(3G),      glColor(3G),      glEnable(3G),      glEvalCoord(3G),
199       glEvalMesh(3G),     glEvalPoint(3G),     glMap2(3G),     glMapGrid(3G),
200       glNormal(3G), glTexCoord(3G), glVertex(3G)
201
202
203
204                                                                    GLMAP1(3G)
Impressum