What do you need to know about glrotate?

What do you need to know about glrotate?

Specifies the angle of rotation, in degrees. Specify the x, y, and z coordinates of a vector, respectively. glRotate produces a rotation of angle degrees around the vector x y z .

How does glrotate produce a rotation of angle?

glRotate produces a rotation of angle degrees around the vector x y z . The current matrix (see glMatrixMode) is multiplied by a rotation matrix with the product replacing the current matrix, as if glMultMatrix were called with the following matrix as its argument:

How to restore Unrotated coordinate system after glrotate?

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

When is GL _ invalid _ operation generated in OpenGL?

This rotation follows the right-hand rule, so if the vector x y z points toward the user, the rotation will be counterclockwise. GL_INVALID_OPERATION is generated if glRotate is executed between the execution of glBegin and the corresponding execution of glEnd .

Specifies the angle of rotation, in degrees. Specify the x, y, and z coordinates of a vector, respectively. glRotate produces a rotation of angle degrees around the vector ( x, y , z).

How to do a rotation of a vector in glrotate?

Specify the x, y, and z coordinates of a vector, respectively. glRotate produces a rotation of angle degrees around the vector ( x, y , z). The current matrix (see glMatrixMode) is multiplied by a rotation matrix with the product replacing the current matrix, as if glMultMatrix were called with the following matrix as its argument:

How does the glrotatef function in Win32 work?

The glRotatef function 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 (see glMatrixMode) is multiplied by this rotation matrix, with the product replacing the current matrix.

How to use gltranslatef, glscalef, and glrotatef in OpenGL?

While glRotatetf followed by glTranslatef results in: Since you object is displaced, you have to translate it in that way, that the rotation point is placed in the origin: Note, on the Fixed Function Pipeline stack you have to “push” this operations in the reverse order. Further you should use the GL_MODELVIEW matrix stack. ( See glMatrixMode ).