![]() -> Click here to learn how to get live help <- |
GLROTATEIndexNAMEglRotated, glRotatef - multiply the current matrix by a rotation matrixC SPECIFICATIONvoid f3glRotatedfP( GLdouble fIanglefP,GLfloat fIxfP, GLfloat fIyfP, GLfloat fIzfP ) PARAMETERS
DESCRIPTION%f3glRotatefP produces a rotation of f2anglefP degrees around the vector $("x", "y", "z")$. The current matrix (see %f3glMatrixModefP) is multiplied by a rotation matrix with the product replacing the current matrix, as if %f3glMultMatrixfP were called with the following matrix as its argument: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 %f3GL_MODELVIEWfP or %f3GL_PROJECTIONfP, all objects drawn after %f3glRotatefP is called are rotated. Use %f3glPushMatrixfP and %f3glPopMatrixfP to save and restore the unrotated coordinate system. NOTESThis rotation follows the right-hand rule, so if the vector $("x", "y", "z")$ points toward the user, the rotation will be counterclockwise.ERRORS%f3GL_INVALID_OPERATIONfP is generated if %f3glRotatefP is executed between the execution of %f3glBeginfP and the corresponding execution of %f3glEndfP.ASSOCIATED GETS%f3glGetfP with argument %f3GL_MATRIX_MODEfP%f3glGetfP with argument %f3GL_COLOR_MATRIXfP %f3glGetfP with argument %f3GL_MODELVIEW_MATRIXfP %f3glGetfP with argument %f3GL_PROJECTION_MATRIXfP %f3glGetfP with argument %f3GL_TEXTURE_MATRIXfP SEE ALSO%f3glMatrixMode(3G)fP, %f3glMultMatrix(3G)fP, %f3glPushMatrix(3G)fP, %f3glScale(3G)fP, %f3glTranslate(3G)fP
Index |