gl.EvalCoord(u[, v])
gl.EvalCoord()
evaluates enabled one- or two-dimensional maps at argument u
or u
and v
. To define a map, call gl.Map();
to enable and disable it, call gl.Enable() and gl.Disable().
When the gl.EvalCoord()
command is issued, all currently enabled maps of the indicated dimension are evaluated. Then, for each enabled
map, it is as if the corresponding GL command had been issued with the computed value. That is, if #GL_MAP1_INDEX
or #GL_MAP2_INDEX
is
enabled, a gl.Index() command is simulated. If #GL_MAP1_COLOR_4
or #GL_MAP2_COLOR_4
is enabled, a gl.Color()
command is simulated. If #GL_MAP1_NORMAL
or #GL_MAP2_NORMAL
is enabled, a normal vector is produced, and if any of the constants #GL_MAP1_TEXTURE_COORD_1
,
#GL_MAP1_TEXTURE_COORD_2
, #GL_MAP1_TEXTURE_COORD_3
, #GL_MAP1_TEXTURE_COORD_4
, or also the constants #GL_MAP2_TEXTURE_COORD_1
, #GL_MAP2_TEXTURE_COORD_2
,
#GL_MAP2_TEXTURE_COORD_3
, or #GL_MAP2_TEXTURE_COORD_4
is enabled, then the GL will simulate an appropriate gl.TexCoord() command.
For color, color index, normal, and texture coordinates the GL uses evaluated values instead of current values for those evaluations
that are enabled, and current values otherwise, However, the evaluated values do not update the current values. Thus, if gl.Vertex()
commands are interspersed with gl.EvalCoord()
commands, the color, normal, and texture coordinates associated with the gl.Vertex()
commands are not affected by the values generated by the gl.EvalCoord()
commands, but only by the most recent gl.Color(),
gl.Index(), gl.Normal(), and gl.TexCoord() commands.
No commands are issued for maps that are not enabled. If more than one texture evaluation is enabled for a particular dimension (for example,
#GL_MAP2_TEXTURE_COORD_1
and #GL_MAP2_TEXTURE_COORD_2
), then only the evaluation of the map that produces the larger number of coordinates
(in this case, #GL_MAP2_TEXTURE_COORD_2
) is carried out. #GL_MAP1_VERTEX_4
overrides #GL_MAP1_VERTEX_3
, and #GL_MAP2_VERTEX_4
overrides
#GL_MAP2_VERTEX_3
, in the same manner. If neither a three- nor a four-component vertex map is enabled for the specified dimension, the
gl.EvalCoord()
command is ignored.
If you have enabled automatic normal generation, by calling gl.Enable() with argument #GL_AUTO_NORMAL
, gl.EvalCoord()
generates surface normals analytically, regardless of the contents or enabling of the #GL_MAP2_NORMAL
map. If automatic normal generation
is disabled, the corresponding normal map #GL_MAP2_NORMAL
, if enabled, is used to produce a normal. If neither automatic normal generation
nor a normal map is enabled, no normal is generated for gl.EvalCoord()
commands.
Alternatively, you can also pass a table containing one or two domain coordinates to gl.EvalCoord()
.
Please consult an OpenGL reference manual for more information.
#GL_MAP1_VERTEX_3
gl.IsEnabled() with argument #GL_MAP1_VERTEX_4
gl.IsEnabled() with argument #GL_MAP1_INDEX
gl.IsEnabled() with argument #GL_MAP1_COLOR_4
gl.IsEnabled() with argument #GL_MAP1_NORMAL
gl.IsEnabled() with argument #GL_MAP1_TEXTURE_COORD_1
gl.IsEnabled() with argument #GL_MAP1_TEXTURE_COORD_2
gl.IsEnabled() with argument #GL_MAP1_TEXTURE_COORD_3
gl.IsEnabled() with argument #GL_MAP1_TEXTURE_COORD_4
gl.IsEnabled() with argument #GL_MAP2_VERTEX_3
gl.IsEnabled() with argument #GL_MAP2_VERTEX_4
gl.IsEnabled() with argument #GL_MAP2_INDEX
gl.IsEnabled() with argument #GL_MAP2_COLOR_4
gl.IsEnabled() with argument #GL_MAP2_NORMAL
gl.IsEnabled() with argument #GL_MAP2_TEXTURE_COORD_1
gl.IsEnabled() with argument #GL_MAP2_TEXTURE_COORD_2
gl.IsEnabled() with argument #GL_MAP2_TEXTURE_COORD_3
gl.IsEnabled() with argument #GL_MAP2_TEXTURE_COORD_4
gl.IsEnabled() with argument #GL_AUTO_NORMAL