1gleTextureMode(3GLE) GLE gleTextureMode(3GLE)
2
3
4
6 gleTextureMode - set the type of GLE automatic texture coordinate gen‐
7 eration.
8
10 void gleTextureMode (int mode);
11
13 mode bitwise OR of GLE texture mode flags
14
16 In addition to the default glTexGen modes that are supplied by OpenGL,
17 the tubing library also contains some of its own automatic texture
18 coordinate generation routines. In addition, user-defined texture coord
19 generation routines can be supplied.
20
21 To use texture mapping with the extrusion library, one must remember to
22 "do the obvious":
23
24 Enable texture mapping through OpenGL
25
26 Define and load (glTexImage2D/glBindTexture) a texture
27
28 If using the routine below, then disable glTexgGen
29
30 gleTextureMode can be used to set the type of automatic texture coordi‐
31 nate generation to be used. The argument should be a bitwise-OR of any
32 of the following flags:
33
34 GLE_TEXTURE_ENABLE
35 If this bit is set, then texturing is enabled. If this bit is
36 NOT set, then automatic texture coordinate generation is dis‐
37 abled.
38
39 The way in which the automatic texture coordinate generation occurs is
40 determined by one of the following flags. One and only one of these
41 should be selected at a time. These tokens are enumerants, not bit-
42 flags.
43
44 GLE_TEXTURE_VERTEX_FLAT
45 Uses the vertexes "x" coordinate as the texture "u" coordinate,
46 and the accumulated segment length as the "v" coordinate.
47
48 GLE_TEXTURE_NORMAL_FLAT
49 Uses the normal vector's "x" coordinate as the texture "u" coor‐
50 dinate, and the accumulated segment length as the "v" coordi‐
51 nate.
52
53 GLE_TEXTURE_VERTEX_CYL
54 Uses u = phi/(2*pi) = arctan (vy/vx)/(2*pi) as the texture "u"
55 coordinate, and the accumulated segment length as the "v" coor‐
56 dinate. In the above equation, "vx" and "vy" stand for the ver‐
57 tex's x and y coordinates.
58
59 GLE_TEXTURE_NORMAL_CYL
60 Uses u = phi/(2*pi) = arctan (ny/nx)/(2*pi) as the texture "u"
61 coordinate, and the accumulated segment length as the "v" coor‐
62 dinate. In the above equation, "nx" and "ny" stand for the nor‐
63 mal's x and y coordinates.
64
65 GLE_TEXTURE_VERTEX_SPH
66 Uses u = phi/(2*pi) = arctan (vy/vx)/(2*pi) as the texture "u"
67 coordinate, and v = theta/pi = (1.0 - arccos(vz))/pi as the tex‐
68 ture "v" coordinate. In the above equation, "vx","vy" and "vz"
69 stand for the vertex's x, y and z coordinates.
70
71 GLE_TEXTURE_NORMAL_SPH
72 Uses u = phi/(2*pi) = arctan (ny/nx)/(2*pi) as the texture "u"
73 coordinate, and v = theta/pi = (1.0 - arccos(nz))/pi as the tex‐
74 ture "v" coordinate. In the above equation, "nx","ny" and "nz"
75 stand for the normal's x, y and z coordinates.
76
77 GLE_TEXTURE_VERTEX_MODEL_FLAT
78
79 GLE_TEXTURE_NORMAL_MODEL_FLAT
80
81 GLE_TEXTURE_VERTEX_MODEL_CYL
82
83 GLE_TEXTURE_NORMAL_MODEL_CYL
84
85 GLE_TEXTURE_VERTEX_MODEL_SPH
86
87 GLE_TEXTURE_NORMAL_MODEL_SPH
88 These define texture mapping modes that are very similar to
89 those described above, except that the untransformed vertices
90 and/or normals are used. As a result, textures tends to stick to
91 the extrusion according to the extrusions local surface coordi‐
92 nates rather than according to real-space coordinates. This will
93 in general provide the corre