GLenum _p_n_a_m_e, GLdouble _p_a_r_a_m )void ggllTTeexxGGeennff( GLenum _c_o_o_r_d,
GLenum _p_n_a_m_e, GLfloat _p_a_r_a_m )void ggllTTeexxGGeennii( GLenum _c_o_o_r_d,
GLenum _p_n_a_m_e, GLint _p_a_r_a_m )
delim $$
GLenum _p_n_a_m_e, const GLdouble _*_p_a_r_a_m_s )void ggllTTeexxGGeennffvv( GLenum _c_o_o_r_d,
GLenum _p_n_a_m_e, const GLfloat _*_p_a_r_a_m_s )void ggllTTeexxGGeenniivv( GLenum _c_o_o_r_d,
GLenum _p_n_a_m_e, const GLint _*_p_a_r_a_m_s )
If the texture generation function is GGLL__OOBBJJEECCTT__LLIINNEEAARR, the function
$g ~=~ p sub 1^x sub o ~+~ p sub 2^y sub o ~+~ p sub 3^z sub o ~+~ p sub 4^w sub o$
is used, where $g$ is the value computed for the coordinate named in _c_o_o_r_d,
$p sub 1$,
$p sub 2$,
$p sub 3$,
and
$p sub 4$ are the four values supplied in _p_a_r_a_m_s, and
$x sub o$,
$y sub o$,
$z sub o$, and
$w sub o$ are the object coordinates of the vertex.
This function can be used, for example, to texture-map terrain using sea level
as a reference plane
(defined by $p sub 1$, $p sub 2$, $p sub 3$, and $p sub 4$).
The altitude of a terrain vertex is computed by the GGLL__OOBBJJEECCTT__LLIINNEEAARR
coordinate generation function as its distance from sea level;
that altitude can then be used to index the texture image to map white snow
onto peaks and green grass onto foothills.
If the texture generation function is GGLL__EEYYEE__LLIINNEEAARR, the function
$g ~=~ p sub 1 sup prime ^x sub e ~+~ p sub 2 sup prime ^y sub e ~+~ p sub 3 sup prime ^z sub e ~+~ p sub 4 sup prime ^w sub e$
is used, where
$( p sub 1 sup prime ~~p sub 2 sup prime~~p sub 3 sup prime~~ { p sub 4 sup prime}) ~=~ ( p sub 1~~ p sub 2~~ p sub 3~~ p sub 4 ) ~M sup -1$
and
$x sub e$,
$y sub e$,
$z sub e$, and
$w sub e$ are the eye coordinates of the vertex,
$p sub 1$,
$p sub 2$,
$p sub 3$,
and
$p sub 4$ are the values supplied in _p_a_r_a_m_s, and
$M$ is the modelview matrix when ggllTTeexxGGeenn is invoked.
If $M$ is poorly conditioned or singular,
texture coordinates generated by the resulting function may be inaccurate
or undefined.
Note that the values in _p_a_r_a_m_s define a reference plane in eye coordinates. The modelview matrix that is applied to them may not be the same one in effect when the polygon vertices are transformed. This function establishes a field of texture coordinates that can produce dynamic contour lines on moving objects.
If _p_n_a_m_e is GGLL__SSPPHHEERREE__MMAAPP and _c_o_o_r_d is either GGLL__SS or GGLL__TT, $s$ and $t$ texture coordinates are generated as follows. Let _u be the unit vector pointing from the origin to the polygon vertex (in eye coordinates). Let _n sup prime be the current normal, after transformation to eye coordinates. Let
$f ~=~ ( f sub x~~f sub y~~f sub z ) sup T$ be the reflection vector such that
$f ~=~ u ~-~ 2 n sup prime n sup prime sup T u$
Finally, let $ m ~=~ 2 sqrt { f sub x sup {~2} ~+~ f sub y sup {~2} ~+~ (f sub z ~+~ 1 ) sup 2}$. Then the values assigned to the $s$ and $t$ texture coordinates are
To enable or disable a texture-coordinate generation function, call ggllEEnnaabbllee or ggllDDiissaabbllee with one of the symbolic texture-coordinate names (GGLL__TTEEXXTTUURREE__GGEENN__SS, GGLL__TTEEXXTTUURREE__GGEENN__TT, GGLL__TTEEXXTTUURREE__GGEENN__RR, or GGLL__TTEEXXTTUURREE__GGEENN__QQ) as the argument. When enabled, the specified texture coordinate is computed according to the generating function associated with that coordinate. When disabled, subsequent vertices take the specified texture coordinate from the current set of texture coordinates. Initially, all texture generation functions are set to GGLL__EEYYEE__LLIINNEEAARR and are disabled. Both $s$ plane equations are (1, 0, 0, 0), both $t$ plane equations are (0, 1, 0, 0), and all $r$ and $q$ plane equations are (0, 0, 0, 0).
When the GGLL__AARRBB__mmuullttiitteexxttuurree extension is supported, ggllTTeexxGGeenn set the texture generation parameters for the currently active texture unit, selected with ggllAAccttiivveeTTeexxttuurreeAARRBB.
GGLL__IINNVVAALLIIDD__EENNUUMM is generated when _p_n_a_m_e is GGLL__TTEEXXTTUURREE__GGEENN__MMOODDEE, _p_a_r_a_m_s is GGLL__SSPPHHEERREE__MMAAPP, and _c_o_o_r_d is either GGLL__RR or GGLL__QQ.
GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllTTeexxGGeenn is executed between the execution of ggllBBeeggiinn and the corresponding execution of ggllEEnndd.