glRotate

multiply the current matrix by a rotation matrix

Signature

glRotate( )->
glRotate( angle , x , y , z )
glRotated( GLdouble ( angle ) , GLdouble ( x ) , GLdouble ( y ) , GLdouble ( z ) )-> void
glRotated( angle , x , y , z )
glRotatef( GLfloat ( angle ) , GLfloat ( x ) , GLfloat ( y ) , GLfloat ( z ) )-> void
glRotatef( angle , x , y , z )

Parameters

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

Description

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:
x 2 1 - c + c x y 1 - c - z s x z 1 - c + y s 0 y x 1 - c + z s y 2 1 - c + c y z 1 - c - x s 0 x z 1 - c - y s y z 1 - c + x s 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 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.

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_OPERATION is generated if glRotate is executed between the execution of glBegin and the corresponding execution of glEnd .

Associated Gets

glGet with argument GL_MATRIX_MODE
glGet with argument GL_COLOR_MATRIX
glGet with argument GL_MODELVIEW_MATRIX
glGet with argument GL_PROJECTION_MATRIX
glGet with argument GL_TEXTURE_MATRIX

See Also

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glRotate
OpenGLContext OpenGLContext/move/viewplatform.py Lines: 145
OpenGLContext OpenGLContext/shadow/shadowcontext.py Lines: 25
OpenGLContext OpenGLContext/passes/rendervisitor.py Lines: 216
OpenGLContext tests/shaders.py Lines: 24, 25
OpenGLContext tests/shader_3.py Lines: 160
OpenGLContext tests/solid_font.py Lines: 71
OpenGLContext tests/shader_4_subset.py Lines: 61
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/checker.py Lines: 96
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/lorentz.py Lines: 109
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/arraytest.py Lines: 81
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/text.py Lines: 103
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/cone.py Lines: 97
{LGPL} PyUI2 renderers/openglBase.py Lines: 227
{LGPL} VisionEgg VisionEgg/MoreStimuli.py Lines: 114, 318
{LGPL} VisionEgg VisionEgg/Gratings.py Lines: 335
{LGPL} VisionEgg VisionEgg/Textures.py Lines: 1473
{LGPL} VisionEgg VisionEgg/Text.py Lines: 481
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Examples/simplecube/simplecube_controlled.py Lines: 123, 124
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Examples/simplecube/simplecube.py Lines: 62
{LGPL or GPL or MPL} Kamaelia Sketches/MPS/Old/SoC/simplecube.py Lines: 99
{LGPL or GPL or MPL} Kamaelia Sketches/THF/simplecube/simplecube_controlled.py Lines: 122, 123
{LGPL or GPL or MPL} Kamaelia Sketches/THF/simplecube/simplecube.py Lines: 62
Visvis core/cameras.py Lines: 1165, 1166, 1167, 1785
Visvis core/base.py Lines: 814
{GPL3} OpenGL-Programmable 05-shader.py Lines: 128
{GPL3} OpenGL-Programmable 07-attrib.py Lines: 145
{GPL3} OpenGL-Programmable 03-array.py Lines: 61
{GPL3} OpenGL-Programmable 06-perpixel.py Lines: 136
{GPL3} OpenGL-Programmable 02-displaylist.py Lines: 61
{GPL3} OpenGL-Programmable 04-vbo.py Lines: 62
{GPL3} OpenGL-Programmable 01-direct.py Lines: 61
{GPL3} OpenGL-Programmable 08-pbo.py Lines: 156
glRotated
OpenGLContext OpenGLContext/wxcontext.py Lines: 346, 347
OpenGLContext OpenGLContext/pygamecontext.py Lines: 150, 151
OpenGLContext OpenGLContext/pygameinteractivecontext.py Lines: 30, 31
OpenGLContext OpenGLContext/scenegraph/transform.py Lines: 34, 45, 53
OpenGLContext tests/nehe6_multi.py Lines: 77, 78, 79
OpenGLContext tests/nehe5.py Lines: 28, 33
OpenGLContext tests/nehe6_compressed.py Lines: 49
OpenGLContext tests/readpixelsleak.py Lines: 20
OpenGLContext tests/nehe8.py Lines: 85
OpenGLContext tests/nehe6_convolve.py Lines: 139
OpenGLContext tests/nehe7.py Lines: 147
OpenGLContext tests/glut_fullscreen.py Lines: 22
OpenGLContext tests/saveimage.py Lines: 40
OpenGLContext tests/nehe6_timer.py Lines: 82, 83, 84
OpenGLContext tests/nehe6.py Lines: 68
OpenGLContext tests/nehe4.py Lines: 51, 67
OpenGL-Demo PyOpenGL-Demo/redbook/movelight.py Lines: 99
{LGPL} PyMT examples/apps/pictures/pictures.py Lines: 31
{LGPL} PyMT examples/games/untangle/data_viewer.py Lines: 64, 66
glRotatef
OpenGLContext tests/redbook_alpha3D.py Lines: 134, 135
OpenGLContext tests/redbook_surface.py Lines: 71
OpenGLContext tests/redbook_trim.py Lines: 99
OpenGLContext tests/redbook_surface_cb.py Lines: 88
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson11.py Lines: 83, 84, 85
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson18.py Lines: 192, 193, 194
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6.py Lines: 118, 119, 120
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson16.py Lines: 101, 102, 103
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson23.py Lines: 150, 151, 152
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson5.py Lines: 96, 133
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson4.py Lines: 98, 117
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson26.py Lines: 170, 171, 190, 191
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson12.py Lines: 121, 122
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson42.py Lines: 314, 315, 316, 324, 325, 339, 340, 341
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6-multi.py Lines: 155, 156, 157
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson45.py Lines: 404, 405
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson44/lesson44.py Lines: 364, 365
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson44/glCamera.py Lines: 697, 698, 723, 724, 743, 744
OpenGL-Demo PyOpenGL-Demo/proesch/bezier/bezier.py Lines: 97, 98
OpenGL-Demo PyOpenGL-Demo/proesch/nurbs/nurbs.py Lines: 151, 152
OpenGL-Demo PyOpenGL-Demo/GLE/texas.py Lines: 47, 48
OpenGL-Demo PyOpenGL-Demo/GLE/helix.py Lines: 19, 20
OpenGL-Demo PyOpenGL-Demo/GLE/cone.py Lines: 21, 22
OpenGL-Demo PyOpenGL-Demo/GLUT/gears.py Lines: 140, 141, 142, 146, 152, 158
OpenGL-Demo PyOpenGL-Demo/GLUT/glutplane.py Lines: 66, 67
OpenGL-Demo PyOpenGL-Demo/GLUT/molehill.py Lines: 136
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/cone.py Lines: 26
OpenGL-Demo PyOpenGL-Demo/redbook/scene.py Lines: 87, 90, 96
OpenGL-Demo PyOpenGL-Demo/redbook/double.py Lines: 69
OpenGL-Demo PyOpenGL-Demo/tom/conechecker.py Lines: 50
OpenGL-Demo PyOpenGL-Demo/tom/conesave.py Lines: 31
OpenGL-Demo PyOpenGL-Demo/tom/cone.py Lines: 28
{Artistic License} PymmLib pymmlib/mmLib/OpenGLDriver.py Lines: 277
{LGPL} VisionEgg VisionEgg/Core.py Lines: 825
{LGPL} VisionEgg VisionEgg/SphereMap.py Lines: 253, 254, 541, 542, 837, 838, 841, 1213, 1214
{LGPL} VisionEgg VisionEgg/Textures.py Lines: 1802, 1886, 1887, 1890, 1894
{LGPL} VisionEgg test/conform.py Lines: 188, 218
{LGPL} PyMT examples/apps/3Ddrawing/3Ddrawing.py Lines: 111, 112, 113, 137
{LGPL} PyMT examples/apps/3Dviewer/3Dviewer.py Lines: 90, 156, 157, 158
{LGPL} PyMT pymt/ui/window/__init__.py Lines: 20, 469
{LGPL} PyMT pymt/ui/widgets/objectdisplay.py Lines: 7, 39
{LGPL} PyMT pymt/ui/widgets/coverflow.py Lines: 7, 273, 316
{LGPL} PyMT pymt/ui/widgets/flippable.py Lines: 8, 139, 141
{LGPL} PyMT pymt/ui/widgets/circularslider.py Lines: 8, 149
{LGPL} PyMT pymt/lib/squirtle.py Lines: 16, 492
{LGPL} Pyggel pyggel/image.py Lines: 94, 95, 96, 162, 163, 164
{LGPL} Pyggel pyggel/misc.py Lines: 216, 217, 218, 327, 328, 329
{LGPL} Pyggel pyggel/camera.py Lines: 58, 59, 60, 77, 78, 79, 83, 84, 85, 102, 103, 104, 109, 110, 111, 115, 116, 117
{LGPL} Pyggel pyggel/geometry.py Lines: 142, 143, 144, 297, 298, 299, 447, 448, 449, 576, 577, 578
{LGPL} Pyggel pyggel/font.py Lines: 313, 314, 315, 520, 521, 522, 953, 954, 955, 995, 996, 997
{LGPL} Pyggel pyggel/mesh.py Lines: 213, 214, 215, 304, 305, 306, 761, 762, 763
{LGPL} pygl2d pygl2d/image.py Lines: 170
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Utils/Particles3D.py Lines: 352
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Experiments/Cubes.py Lines: 181, 182
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Experiments/Spheres.py Lines: 120, 121, 122

MathML Rendering

Powered by MathJax