glRotate(3) glRotate(3)

## NAME

glRotated,glRotatef- multiply the current matrix by a rotation matrix

## C SPECIFICATION

voidglRotated( GLdoubleangle, GLdoublex, GLdoubley, GLdoublez) voidglRotatef( GLfloatangle, GLfloatx, GLfloaty, GLfloatz)

## PARAMETERS

angleSpecifies the angle of rotation, in degrees.x,y,zSpecify thex,y, andzcoordinates of a vector, respectively.

## DESCRIPTION

glRotateproduces a rotation ofangledegrees around the vector (x, y, z). The current matrix (seeglMatrixMode) is multiplied by a rotation matrix with the product replacing the current matrix, as ifglMultMatrixwere called with the following matrix as its argument: x^2(1-c)+c xy(1-c)-zs xz(1-c)+ys 0 yx(1-c)+zs y^2(1-c)+c yz(1-c)-xs 0 xz(1-c)-ys yz(1-c)+xs z^2(1-c)+c 0 0 0 0 1 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 eitherGL_MODELVIEWorGL_PROJECTION, all objects drawn afterglRotateis called are rotated. UseglPushMatrixandglPopMatrixto 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

GL_INVALID_OPERATIONis generated ifglRotateis executed between the execution ofglBeginand the corresponding execution ofglEnd.

## ASSOCIATED GETS

glGetwith argumentGL_MATRIX_MODEglGetwith argumentGL_COLOR_MATRIXglGetwith argumentGL_MODELVIEW_MATRIXglGetwith argumentGL_PROJECTION_MATRIXglGetwith argumentGL_TEXTURE_MATRIX

## SEE ALSO

glMatrixMode(3),glMultMatrix(3),glPushMatrix(3),glScale(3),glTranslate(3)glRotate(3)

Mac OS X 10.6 - Generated Thu Sep 17 20:20:28 CDT 2009