NAME
glRotated, glRotatef
- multiply the current matrix by a rotation matrix
C SPECIFICATION
void ggllRRoottaatteedd(
GLdouble _a_n_g_l_e,
GLdouble _x,
GLdouble _y,
GLdouble _z )
void ggllRRoottaatteeff(
GLfloat _a_n_g_l_e,
GLfloat _x,
GLfloat _y,
GLfloat _z )
delim $$
PARAMETERS
-
_a_n_g_l_e
-
Specifies the angle of rotation, in degrees.
-
_x, _y, _z
-
Specify the _x, _y, and _z coordinates of a vector, respectively.
DESCRIPTION
ggllRRoottaattee produces a rotation of _a_n_g_l_e degrees around
the vector $("x", "y", "z")$.
The current matrix (see ggllMMaattrriixxMMooddee) is multiplied by a rotation
matrix with the product
replacing the current matrix, as if ggllMMuullttMMaattrriixx were called
with the following matrix as its argument:
left ( ~ down 20 matrix {
ccol {
"x" sup 2 (1 ^-^ c)~+~ c above
"y" "x" (1 ^-^ c)~+~ "z" s above
"x" "z" (1 ^-^ c)~-~"y" s above
~0
}
ccol {
~~ "x" "y" (1 ^-^ c)~-~"z" s above
~~ "y" sup 2 (1 ^-^ c)~+~ c above
~~ "y" "z" (1 ^-^ c)~+~ "x" s above
~~ ~0
}
ccol {
~~ "x" "z" (1 ^-^ c)~+~ "y" s above
~~ "y" "z" (1 ^-^ c)~-~ "x" s above
~~ "z" sup 2 (1 ^-^ c) ~+~ c above
~~ ~0
}
ccol { ~0 above ~0 above ~0 above ~1}
} ~~ right )
Where $c ~=~ cos ("angle")$, $s ~=~ sin ("angle")$, and
$||(~"x", "y", "z"~)|| ~=~ 1$ (if not, the GL
will normalize this vector).
If the matrix mode is either GGLL__MMOODDEELLVVIIEEWW or GGLL__PPRROOJJEECCTTIIOONN,
all objects drawn after ggllRRoottaattee is called are rotated.
Use ggllPPuusshhMMaattrriixx and ggllPPooppMMaattrriixx to save and restore
the unrotated coordinate system.
NOTES
This rotation follows the right-hand rule, so
if the vector $("x", "y", "z")$ points toward the
user, the rotation will be counterclockwise.
ERRORS
GGLL__IINNVVAALLIIDD__OOPPEERRAATTIIOONN is generated if ggllRRoottaattee
is executed between the execution of ggllBBeeggiinn
and the corresponding execution of ggllEEnndd.
ASSOCIATED GETS
ggllGGeett with argument GGLL__MMAATTRRIIXX__MMOODDEE
ggllGGeett with argument GGLL__CCOOLLOORR__MMAATTRRIIXX
ggllGGeett with argument GGLL__MMOODDEELLVVIIEEWW__MMAATTRRIIXX
ggllGGeett with argument GGLL__PPRROOJJEECCTTIIOONN__MMAATTRRIIXX
ggllGGeett with argument GGLL__TTEEXXTTUURREE__MMAATTRRIIXX
SEE ALSO
ggllMMaattrriixxMMooddee((33GG)),
ggllMMuullttMMaattrriixx((33GG)),
ggllPPuusshhMMaattrriixx((33GG)),
ggllSSccaallee((33GG)),
ggllTTrraannssllaattee((33GG))