File: map2.3gl

package info (click to toggle)
vnc4 4.1.1%2BX4.3.0-37
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 171,636 kB
  • ctags: 288,245
  • sloc: ansic: 2,205,268; cpp: 56,345; sh: 38,092; pascal: 13,773; asm: 12,656; tcl: 9,182; lisp: 7,831; perl: 3,364; makefile: 2,957; yacc: 2,902; objc: 2,698; xml: 2,614; python: 2,383; lex: 1,477; awk: 901; csh: 58; sed: 50
file content (331 lines) | stat: -rw-r--r-- 11,054 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
'\" te
'\"! tbl|eqn | mmdoc
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 24 September 1999
.ds Re Release 1.2.1
.ds Dp Jan 14 18:30
.ds Dm 01 map2.gl -
.ds Xs 16004 12 map2.gl
.TH GLMAP2 3G
.SH NAME
.B "glMap2d, glMap2f
\- define a two-dimensional evaluator

.SH C SPECIFICATION
void \f3glMap2d\fP(
GLenum \fItarget\fP,
.nf
.ta \w'\f3void \fPglMap2d( 'u
	GLdouble \fIu1\fP,
	GLdouble \fIu2\fP,
	GLint \fIustride\fP,
	GLint \fIuorder\fP,
	GLdouble \fIv1\fP,
	GLdouble \fIv2\fP,
	GLint \fIvstride\fP,
	GLint \fIvorder\fP,
	const GLdouble \fI*points\fP )
.fi
void \f3glMap2f\fP(
GLenum \fItarget\fP,
.nf
.ta \w'\f3void \fPglMap2f( 'u
	GLfloat \fIu1\fP,
	GLfloat \fIu2\fP,
	GLint \fIustride\fP,
	GLint \fIuorder\fP,
	GLfloat \fIv1\fP,
	GLfloat \fIv2\fP,
	GLint \fIvstride\fP,
	GLint \fIvorder\fP,
	const GLfloat \fI*points\fP )
.fi

.EQ
delim $$
.EN
.SH PARAMETERS
.TP \w'\fIustride\fP\ \ 'u 
\f2target\fP
Specifies the kind of values that are generated by the evaluator.
Symbolic constants
\%\f3GL_MAP2_VERTEX_3\fP,
\%\f3GL_MAP2_VERTEX_4\fP,
\%\f3GL_MAP2_INDEX\fP,
\%\f3GL_MAP2_COLOR_4\fP,
\%\f3GL_MAP2_NORMAL\fP,
\%\f3GL_MAP2_TEXTURE_COORD_1\fP,
\%\f3GL_MAP2_TEXTURE_COORD_2\fP,
\%\f3GL_MAP2_TEXTURE_COORD_3\fP, and
\%\f3GL_MAP2_TEXTURE_COORD_4\fP are accepted.
.TP
\f2u1\fP, \f2u2\fP
Specify a linear mapping of $u$,
as presented to \%\f3glEvalCoord2\fP,
to $u hat$,
one of the two variables that are evaluated by the equations specified
by this command. Initially, \f2u1\fP is 0 and \f2u2\fP is 1.
.TP
\f2ustride\fP
Specifies the number of floats or doubles between
the beginning of control point
$R sub ij$
and the beginning of control point
$R sub { (i+1) j }$,
where $i$ and $j$ are the $u$ and $v$ control point indices, respectively.
This allows control points to be embedded in arbitrary data structures.
The only constraint is that the values for a particular control point
must occupy contiguous memory locations. The initial value of \f2ustride\fP is 0. 
.TP
\f2uorder\fP
Specifies the dimension of the control point array in the $u$ axis.
Must be positive. The initial value is 1.
.TP
\f2v1\fP, \f2v2\fP
Specify a linear mapping of $v$,
as presented to \%\f3glEvalCoord2\fP,
to $v hat$,
one of the two variables that are evaluated by the equations specified
by this command. Initially, \f2v1\fP is 0 and \f2v2\fP is 1. 
.TP
\f2vstride\fP
Specifies the number of floats or doubles between
the beginning of control point
$R sub ij$
and the beginning of control point
$R sub { i (j+1) }$,
where $i$ and $j$ are the $u$ and $v$ control point indices, respectively.
This allows control points to be embedded in arbitrary data structures.
The only constraint is that the values for a particular control point
must occupy contiguous memory locations. The initial value of \f2vstride\fP is 0.
.TP
\f2vorder\fP
Specifies the dimension of the control point array in the $v$ axis.
Must be positive. The initial value is 1. 
.TP
\f2points\fP
Specifies a pointer to the array of control points.
.SH DESCRIPTION
Evaluators provide a way to use polynomial or rational polynomial mapping
to produce vertices,
normals,
texture coordinates,
and colors.
The values produced by an evaluator are sent on to further stages
of GL processing just as if they had been presented using
\%\f3glVertex\fP,
\%\f3glNormal\fP,
\%\f3glTexCoord\fP, and
\%\f3glColor\fP commands,
except that the generated values do not update the current normal,
texture coordinates,
or color.
.P
All polynomial or rational polynomial splines of any degree
(up to the maximum degree supported by the GL implementation)
can be described using evaluators.
These include almost all surfaces used in computer graphics,
including B-spline surfaces,
NURBS surfaces,
Bezier surfaces, and so on.  
.P
Evaluators define surfaces based on bivariate Bernstein polynomials.
Define $p ( u hat , v hat ) $ as
.ce
.sp
.EQ 
p ( u hat , v hat ) ~~=~~
 down 30 {{size 18 {sum}} from {size 8 {i~=~0}} to {size 9 {n}} } ~
 {{size 18 {sum}} from {size 8 {j~=~0}} to {size 9 {m}} } ~
 up 15 { B sub i sup n ( u hat ) ~ B sub j sup m ( v hat ) ~ R sub ij }
.EN
.sp
.P
where $R sub ij$ is a control point,
$B sub i sup n ( u hat )$
is the $i$th Bernstein polynomial of degree 
.br
$n$ (\f2uorder\fP = $n ~+~ 1$)
.ce
.sp
.EQ 
B sub i sup n ( u hat ) ~~=~~ left ( down 20 {cpile { n above i }} ~ right
) u hat sup i ( 1 - u hat ) sup { n - i }
.EN
.sp
and $B sub j sup m ( v hat )$
is the $j$th Bernstein polynomial of degree $m$ (\f2vorder\fP = $m ~+~ 1$)
.ce
.sp
.EQ 
B sub j sup m ( v hat ) ~~=~~ left ( ^down 20 {cpile { m above j }} ~^ right ) v hat sup j ( 1 - v hat ) sup { m - j }
.EN
.sp
Recall that 
.ce
$0 sup 0 ~==~ 1 $ and $ left ( ^ down 20 {cpile { n above 0 }} ~^ right ) ~~==~~ 1 $
.sp
\%\f3glMap2\fP is used to define the basis and to specify what kind of values
are produced.
Once defined,
a map can be enabled and disabled by calling \%\f3glEnable\fP and \%\f3glDisable\fP
with the map name, one of the nine predefined values for \f2target\fP,
described below.
When \%\f3glEvalCoord2\fP presents values $u$ and $v$,
the bivariate Bernstein polynomials are evaluated using $u hat$ and $v hat$,
where
.sp
.ce
$u hat ~~=~~ {u ~-~ "u1"} over {"u2" ~-~ "u1"}$
.sp
.ce
$v hat ~~=~~ {v ~-~ "v1"} over {"v2" ~-~ "v1"}$
.sp
\f2target\fP is a symbolic constant that indicates what kind of control points
are provided in \f2points\fP,
and what output is generated when the map is evaluated.
It can assume one of nine predefined values:
.TP 25
\%\f3GL_MAP2_VERTEX_3\fP
Each control point is three floating-point values representing
$x$, $y$, and $z$.
Internal \%\f3glVertex3\fP commands are generated when the map is evaluated.
.TP
\%\f3GL_MAP2_VERTEX_4\fP
Each control point is four floating-point values representing
$x$, $y$, $z$, and $w$.
Internal \%\f3glVertex4\fP commands are generated when the map is evaluated.
.TP
\%\f3GL_MAP2_INDEX\fP
Each control point is a single floating-point value representing a color index.
Internal \%\f3glIndex\fP commands are generated when the map is evaluated
but the current index is not updated with the value of these
\%\f3glIndex\fP commands. 
.TP
\%\f3GL_MAP2_COLOR_4\fP
Each control point is four floating-point values representing
red, green, blue, and alpha.
Internal \%\f3glColor4\fP commands are generated when the map is
evaluated but the current color is not updated with the value of
these \%\f3glColor4\fP commands.
.TP
\%\f3GL_MAP2_NORMAL\fP
Each control point is three floating-point values representing
the $x$, $y$, and $z$ components of a normal vector.
Internal \%\f3glNormal\fP commands are generated when the map is
evaluated but the current normal is not updated with the value of
these \%\f3glNormal\fP commands.
.TP 
\%\f3GL_MAP2_TEXTURE_COORD_1\fP
Each control point is a single floating-point value representing
the $s$ texture coordinate.
Internal 
.br
\%\f3glTexCoord1\fP commands are generated when the map is evaluated but
the current texture coordinates are not updated with the value 
of these \%\f3glTexCoord\fP commands. 
.TP
\%\f3GL_MAP2_TEXTURE_COORD_2\fP
Each control point is two floating-point values representing
the $s$ and $t$ texture coordinates.
Internal 
.br
\%\f3glTexCoord2\fP commands are generated when the map is evaluated but
the current texture coordinates are not updated with the value 
of these \%\f3glTexCoord\fP commands.
.TP
\%\f3GL_MAP2_TEXTURE_COORD_3\fP
Each control point is three floating-point values representing
the $s$, $t$, and $r$ texture coordinates.
Internal \%\f3glTexCoord3\fP commands are generated when the map is
evaluated but the current texture coordinates are not updated with the value
of these \%\f3glTexCoord\fP commands.
.TP
\%\f3GL_MAP2_TEXTURE_COORD_4\fP
Each control point is four floating-point values representing
the $s$, $t$, $r$, and $q$ texture coordinates.
Internal 
.br
\%\f3glTexCoord4\fP commands are generated when the map is evaluated but the current texture coordinates are not updated with the value
of these \%\f3glTexCoord\fP commands.
.P
\f2ustride\fP,
\f2uorder\fP,
\f2vstride\fP,
\f2vorder\fP, and
\f2points\fP define the array addressing for accessing the control points.
\f2points\fP is the location of the first control point,
which occupies one, two, three, or four contiguous memory locations,
depending on which map is being defined.
There are $ "uorder" ~times~ "vorder" $ control points in the array.
\f2ustride\fP specifies how many float or double locations are skipped to advance
the internal memory pointer from control point
$R sub {i j} $ to control point $R sub {(i+1) j} $.
\f2vstride\fP specifies how many float or double locations are skipped to advance
the internal memory pointer from control point
$R sub {i j} $ to control point $R sub {i (j+1) } $.
.SH NOTES
As is the case with all GL commands that accept pointers to data,
it is as if the contents of \f2points\fP were copied by \%\f3glMap2\fP before \%\f3glMap2\fP
returns.
Changes to the contents of \f2points\fP have no effect after \%\f3glMap2\fP is called.
.P
Initially, \%\f3GL_AUTO_NORMAL\fP is enabled. If \%\f3GL_AUTO_NORMAL\fP is enabled,
normal vectors are generated when either
\%\f3GL_MAP2_VERTEX_3\fP or \%\f3GL_MAP2_VERTEX_4\fP is used to generate
vertices.
.SH ERRORS
\%\f3GL_INVALID_ENUM\fP is generated if \f2target\fP is not an accepted value.
.P
\%\f3GL_INVALID_VALUE\fP is generated if \f2u1\fP is equal to \f2u2\fP,
or if \f2v1\fP is equal to \f2v2\fP.
.P
\%\f3GL_INVALID_VALUE\fP is generated if either \f2ustride\fP or \f2vstride\fP
is less than the number of values in a control point.
.P
\%\f3GL_INVALID_VALUE\fP is generated if either \f2uorder\fP or \f2vorder\fP
is less than 1 or greater than the return value of \%\f3GL_MAX_EVAL_ORDER\fP.
.P
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glMap2\fP
is executed between the execution of
\%\f3glBegin\fP
and the corresponding execution of \%\f3glEnd\fP.
.P
When the \%\f3GL_ARB_multitexture\fP extension is supported,
\%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glMap2\fP is called and the value
of \%\f3GL_ACTIVE_TEXTURE_ARB\fP is not \%\f3GL_TEXTURE0_ARB\fP.
.SH ASSOCIATED GETS
\%\f3glGetMap\fP
.br
\%\f3glGet\fP with argument \%\f3GL_MAX_EVAL_ORDER\fP
.br
\%\f3glIsEnabled\fP with argument \%\f3GL_MAP2_VERTEX_3\fP
.br
\%\f3glIsEnabled\fP with argument \%\f3GL_MAP2_VERTEX_4\fP
.br
\%\f3glIsEnabled\fP with argument \%\f3GL_MAP2_INDEX\fP
.br
\%\f3glIsEnabled\fP with argument \%\f3GL_MAP2_COLOR_4\fP
.br
\%\f3glIsEnabled\fP with argument \%\f3GL_MAP2_NORMAL\fP
.br
\%\f3glIsEnabled\fP with argument \%\f3GL_MAP2_TEXTURE_COORD_1\fP
.br
\%\f3glIsEnabled\fP with argument \%\f3GL_MAP2_TEXTURE_COORD_2\fP
.br
\%\f3glIsEnabled\fP with argument \%\f3GL_MAP2_TEXTURE_COORD_3\fP
.br
\%\f3glIsEnabled\fP with argument \%\f3GL_MAP2_TEXTURE_COORD_4\fP
.SH SEE ALSO
\%\f3glBegin(3G)\fP,
\%\f3glColor(3G)\fP,
\%\f3glEnable(3G)\fP,
\%\f3glEvalCoord(3G)\fP,
\%\f3glEvalMesh(3G)\fP,
\%\f3glEvalPoint(3G)\fP,
\%\f3glMap1(3G)\fP,
\%\f3glMapGrid(3G)\fP,
\%\f3glNormal(3G)\fP,
\%\f3glTexCoord(3G)\fP,
\%\f3glVertex(3G)\fP