[ Previous | Next | Contents | Glossary | Home | Search ]
OpenGL 1.1 for AIX: Reference Manual

glRotate Subroutine

Purpose

Multiplies the current matrix by a rotation matrix.

Library

OpenGL C bindings library: libGL.a

C Syntax

void glRotated(GLdouble Angle, 
    GLdouble X,
    GLdouble Y,
    GLdouble Z)
void glRotatef(GLfloat Angle, 
   GLfloat X,
   GLfloat Y,
   GLfloat Z)

Parameters

Angle Specifies the angle of rotation, in degrees.
X, Y, Z Specify the X, Y, and Z coordinates of a vector, respectively.

Description

The glRotate subroutine computes a matrix that performs a counterclockwise rotation of Angle degrees about the vector from the origin through the point (X, Y, Z).

The current matrix is multiplied by this rotation matrix, with the product replacing the current matrix. That is, if M is the current matrix and R is the translation matrix, M is replaced with MR. (See the glMatrixMode subroutine for information on specifying the current matrix.)

If the matrix mode is either GL_MODELVIEW or GL_PROJECTION, all objects drawn after glRotate is called are rotated. Use the glPushMatrix and glPopMatrix subroutines to save and restore the unrotated coordinate system.

Associated Gets

Associated gets for the glRotate subroutine are as follows. (See the glGet subroutine for more information.)

glGet with argument GL_MATRIX_MODE

glGet with argument GL_MODELVIEW_MATRIX

glGet with argument GL_PROJECTION_MATRIX

glGet with argument GL_TEXTURE_MATRIX.

Errors

GL_INVALID_OPERATION The glRotate subroutine is called between a call to glBegin and the corresponding call to glEnd.

Files

/usr/include/GL/gl.h Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL.

Related Information

The glBegin or glEnd subroutine, glMatrixMode subroutine, glMultMatrix subroutine, glPushMatrix subroutine, glScale subroutine, glTranslate subroutine.

OpenGL Overview.


[ Previous | Next | Contents | Glossary | Home | Search ]