1glu(3) Erlang Module Definition glu(3)
2
3
4
6 glu - Erlang wrapper functions for OpenGL
7
9 Standard OpenGL API
10
11 This documents the functions as a brief version of the complete OpenGL
12 reference pages.
13
15 vertex() = {float(), float(), float()}
16
17 i() = integer()
18
19 f() = float()
20
21 enum() = integer() >= 0
22
23 matrix() = m12() | m16()
24
25 m12() =
26 {f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f(), f()}
27
28 m16() =
29 {f(),
30 f(),
31 f(),
32 f(),
33 f(),
34 f(),
35 f(),
36 f(),
37 f(),
38 f(),
39 f(),
40 f(),
41 f(),
42 f(),
43 f(),
44 f()}
45
46 mem() = binary() | tuple()
47
49 build1DMipmapLevels(Target, InternalFormat, Width, Format, Type,
50 Level, Base, Max, Data) ->
51 i()
52
53 Types:
54
55 Target = enum()
56 InternalFormat = Width = i()
57 Format = Type = enum()
58 Level = Base = Max = i()
59 Data = binary()
60
61 glu:build1DMipmapLevels/9 builds a subset of prefiltered one-di‐
62 mensional texture maps of decreasing resolutions called a
63 mipmap. This is used for the antialiasing of texture mapped
64 primitives.
65
66 External documentation.
67
68 build1DMipmaps(Target, InternalFormat, Width, Format, Type, Data) ->
69 i()
70
71 Types:
72
73 Target = enum()
74 InternalFormat = Width = i()
75 Format = Type = enum()
76 Data = binary()
77
78 glu:build1DMipmaps/6 builds a series of prefiltered one-dimen‐
79 sional texture maps of decreasing resolutions called a mipmap.
80 This is used for the antialiasing of texture mapped primitives.
81
82 External documentation.
83
84 build2DMipmapLevels(Target, InternalFormat, Width, Height, Format,
85 Type, Level, Base, Max, Data) ->
86 i()
87
88 Types:
89
90 Target = enum()
91 InternalFormat = Width = Height = i()
92 Format = Type = enum()
93 Level = Base = Max = i()
94 Data = binary()
95
96 glu:build2DMipmapLevels/10 builds a subset of prefiltered two-
97 dimensional texture maps of decreasing resolutions called a
98 mipmap. This is used for the antialiasing of texture mapped
99 primitives.
100
101 External documentation.
102
103 build2DMipmaps(Target, InternalFormat, Width, Height, Format,
104 Type, Data) ->
105 i()
106
107 Types:
108
109 Target = enum()
110 InternalFormat = Width = Height = i()
111 Format = Type = enum()
112 Data = binary()
113
114 glu:build2DMipmaps/7 builds a series of prefiltered two-dimen‐
115 sional texture maps of decreasing resolutions called a mipmap.
116 This is used for the antialiasing of texture-mapped primitives.
117
118 External documentation.
119
120 build3DMipmapLevels(Target, InternalFormat, Width, Height, Depth,
121 Format, Type, Level, Base, Max, Data) ->
122 i()
123
124 Types:
125
126 Target = enum()
127 InternalFormat = Width = Height = Depth = i()
128 Format = Type = enum()
129 Level = Base = Max = i()
130 Data = binary()
131
132 glu:build3DMipmapLevels/11 builds a subset of prefiltered three-
133 dimensional texture maps of decreasing resolutions called a
134 mipmap. This is used for the antialiasing of texture mapped
135 primitives.
136
137 External documentation.
138
139 build3DMipmaps(Target, InternalFormat, Width, Height, Depth,
140 Format, Type, Data) ->
141 i()
142
143 Types:
144
145 Target = enum()
146 InternalFormat = Width = Height = Depth = i()
147 Format = Type = enum()
148 Data = binary()
149
150 glu:build3DMipmaps/8 builds a series of prefiltered three-dimen‐
151 sional texture maps of decreasing resolutions called a mipmap.
152 This is used for the antialiasing of texture-mapped primitives.
153
154 External documentation.
155
156 checkExtension(ExtName :: string(), ExtString :: string()) ->
157 0 | 1
158
159 glu:checkExtension/2 returns ?GLU_TRUE if ExtName is supported
160 otherwise ?GLU_FALSE is returned.
161
162 External documentation.
163
164 cylinder(Quad :: i(),
165 Base :: f(),
166 Top :: f(),
167 Height :: f(),
168 Slices :: i(),
169 Stacks :: i()) ->
170 ok
171
172 glu:cylinder/6 draws a cylinder oriented along the z axis. The
173 base of the cylinder is placed at z = 0 and the top at z=height.
174 Like a sphere, a cylinder is subdivided around the z axis into
175 slices and along the z axis into stacks.
176
177 External documentation.
178
179 deleteQuadric(Quad :: i()) -> ok
180
181 glu:deleteQuadric/1 destroys the quadrics object (created with
182 glu:newQuadric/0) and frees any memory it uses. Once glu:delete‐
183 Quadric/1 has been called, Quad cannot be used again.
184
185 External documentation.
186
187 disk(Quad :: i(),
188 Inner :: f(),
189 Outer :: f(),
190 Slices :: i(),
191 Loops :: i()) ->
192 ok
193
194 glu:disk/5 renders a disk on the z = 0 plane. The disk has a ra‐
195 dius of Outer and contains a concentric circular hole with a ra‐
196 dius of Inner. If Inner is 0, then no hole is generated. The
197 disk is subdivided around the z axis into slices (like pizza
198 slices) and also about the z axis into rings (as specified by
199 Slices and Loops, respectively).
200
201 External documentation.
202
203 errorString(Error :: enum()) -> string()
204
205 glu:errorString/1 produces an error string from a GL or GLU er‐
206 ror code. The string is in ISO Latin 1 format. For example,
207 glu:errorString/1(?GLU_OUT_OF_MEMORY) returns the string out of
208 memory.
209
210 External documentation.
211
212 getString(Name :: enum()) -> string()
213
214 glu:getString/1 returns a pointer to a static string describing
215 the GLU version or the GLU extensions that are supported.
216
217 External documentation.
218
219 lookAt(EyeX, EyeY, EyeZ, CenterX, CenterY, CenterZ, UpX, UpY, UpZ) ->
220 ok
221
222 Types:
223
224 EyeX = EyeY = EyeZ = CenterX = CenterY = CenterZ = UpX = UpY
225 = UpZ = f()
226
227 glu:lookAt/9 creates a viewing matrix derived from an eye point,
228 a reference point indicating the center of the scene, and an UP
229 vector.
230
231 External documentation.
232
233 newQuadric() -> i()
234
235 glu:newQuadric/0 creates and returns a pointer to a new quadrics
236 object. This object must be referred to when calling quadrics
237 rendering and control functions. A return value of 0 means that
238 there is not enough memory to allocate the object.
239
240 External documentation.
241
242 ortho2D(Left :: f(), Right :: f(), Bottom :: f(), Top :: f()) ->
243 ok
244
245 glu:ortho2D/4 sets up a two-dimensional orthographic viewing re‐
246 gion. This is equivalent to calling gl:ortho/6 with near=-1 and
247 far=1.
248
249 External documentation.
250
251 partialDisk(Quad, Inner, Outer, Slices, Loops, Start, Sweep) -> ok
252
253 Types:
254
255 Quad = i()
256 Inner = Outer = f()
257 Slices = Loops = i()
258 Start = Sweep = f()
259
260 glu:partialDisk/7 renders a partial disk on the z=0 plane. A
261 partial disk is similar to a full disk, except that only the
262 subset of the disk from Start through Start + Sweep is included
263 (where 0 degrees is along the +f2yf axis, 90 degrees along the
264 +x axis, 180 degrees along the -y axis, and 270 degrees along
265 the -x axis).
266
267 External documentation.
268
269 perspective(Fovy :: f(), Aspect :: f(), ZNear :: f(), ZFar :: f()) ->
270 ok
271
272 glu:perspective/4 specifies a viewing frustum into the world co‐
273 ordinate system. In general, the aspect ratio in glu:perspec‐
274 tive/4 should match the aspect ratio of the associated viewport.
275 For example, aspect=2.0 means the viewer's angle of view is
276 twice as wide in x as it is in y. If the viewport is twice as
277 wide as it is tall, it displays the image without distortion.
278
279 External documentation.
280
281 pickMatrix(X :: f(),
282 Y :: f(),
283 DelX :: f(),
284 DelY :: f(),
285 Viewport :: {i(), i(), i(), i()}) ->
286 ok
287
288 glu:pickMatrix/5 creates a projection matrix that can be used to
289 restrict drawing to a small region of the viewport. This is typ‐
290 ically useful to determine what objects are being drawn near the
291 cursor. Use glu:pickMatrix/5 to restrict drawing to a small re‐
292 gion around the cursor. Then, enter selection mode (with gl:ren‐
293 derMode/1) and rerender the scene. All primitives that would
294 have been drawn near the cursor are identified and stored in the
295 selection buffer.
296
297 External documentation.
298
299 project(ObjX, ObjY, ObjZ, Model, Proj, View) ->
300 {i(), WinX :: f(), WinY :: f(), WinZ :: f()}
301
302 Types:
303
304 ObjX = ObjY = ObjZ = f()
305 Model = Proj = matrix()
306 View = {i(), i(), i(), i()}
307
308 glu:project/6 transforms the specified object coordinates into
309 window coordinates using Model, Proj, and View. The result is
310 stored in WinX, WinY, and WinZ. A return value of ?GLU_TRUE in‐
311 dicates success, a return value of ?GLU_FALSE indicates failure.
312
313 External documentation.
314
315 quadricDrawStyle(Quad :: i(), Draw :: enum()) -> ok
316
317 glu:quadricDrawStyle/2 specifies the draw style for quadrics
318 rendered with Quad. The legal values are as follows:
319
320 External documentation.
321
322 quadricNormals(Quad :: i(), Normal :: enum()) -> ok
323
324 glu:quadricNormals/2 specifies what kind of normals are desired
325 for quadrics rendered with Quad. The legal values are as fol‐
326 lows:
327
328 External documentation.
329
330 quadricOrientation(Quad :: i(), Orientation :: enum()) -> ok
331
332 glu:quadricOrientation/2 specifies what kind of orientation is
333 desired for quadrics rendered with Quad. The Orientation values
334 are as follows:
335
336 External documentation.
337
338 quadricTexture(Quad :: i(), Texture :: 0 | 1) -> ok
339
340 glu:quadricTexture/2 specifies if texture coordinates should be
341 generated for quadrics rendered with Quad. If the value of Tex‐
342 ture is ?GLU_TRUE, then texture coordinates are generated, and
343 if Texture is ?GLU_FALSE, they are not. The initial value is
344 ?GLU_FALSE.
345
346 External documentation.
347
348 scaleImage(Format, WIn, HIn, TypeIn, DataIn, WOut, HOut, TypeOut,
349 DataOut) ->
350 i()
351
352 Types:
353
354 Format = enum()
355 WIn = HIn = i()
356 TypeIn = enum()
357 DataIn = binary()
358 WOut = HOut = i()
359 TypeOut = enum()
360 DataOut = mem()
361
362 glu:scaleImage/9 scales a pixel image using the appropriate
363 pixel store modes to unpack data from the source image and pack
364 data into the destination image.
365
366 External documentation.
367
368 sphere(Quad :: i(), Radius :: f(), Slices :: i(), Stacks :: i()) ->
369 ok
370
371 glu:sphere/4 draws a sphere of the given radius centered around
372 the origin. The sphere is subdivided around the z axis into
373 slices and along the z axis into stacks (similar to lines of
374 longitude and latitude).
375
376 External documentation.
377
378 tesselate(Normal, Vs :: [Vs]) -> {Triangles, VertexPos}
379
380 Types:
381
382 Normal = Vs = vertex()
383 Triangles = [integer()]
384 VertexPos = binary()
385
386 Triangulates a polygon, the polygon is specified by a Normal and
387 Vs a list of vertex positions.
388
389 The function returns a list of indices of the vertices and a bi‐
390 nary (64bit native float) containing an array of vertex posi‐
391 tions, it starts with the vertices in Vs and may contain newly
392 created vertices in the end.
393
394 unProject(WinX, WinY, WinZ, Model, Proj, View) ->
395 {i(), ObjX :: f(), ObjY :: f(), ObjZ :: f()}
396
397 unProject4(WinX, WinY, WinZ, ClipW, Model, Proj, View, NearVal,
398 FarVal) ->
399 {i(),
400 ObjX :: f(),
401 ObjY :: f(),
402 ObjZ :: f(),
403 ObjW :: f()}
404
405 Types:
406
407 WinX = WinY = WinZ = ClipW = f()
408 Model = Proj = matrix()
409 View = {i(), i(), i(), i()}
410 NearVal = FarVal = f()
411
412 glu:unProject/6 maps the specified window coordinates into ob‐
413 ject coordinates using Model, Proj, and View. The result is
414 stored in ObjX, ObjY, and ObjZ. A return value of ?GLU_TRUE in‐
415 dicates success; a return value of ?GLU_FALSE indicates failure.
416
417 External documentation.
418
419
420
421Ericsson AB wx 2.2.2 glu(3)