Previous: glMaterial Table of Contents (GL) Next: glMemoryBarrier

glMatrixMode

specify which matrix is the current matrix

Signature

glMatrixMode( GLenum ( mode ) )-> void
glMatrixMode( mode )

Parameters

VariablesDescription
mode
Specifies which matrix stack is the target for subsequent matrix operations. Three values are accepted: GL_MODELVIEW , GL_PROJECTION , and GL_TEXTURE . The initial value is GL_MODELVIEW . Additionally, if the
ARB_imaging
extension is supported, GL_COLOR is also accepted.

Description

glMatrixMode sets the current matrix mode. mode can assume one of four values:
GL_MODELVIEW
Applies subsequent matrix operations to the modelview matrix stack.
GL_PROJECTION
Applies subsequent matrix operations to the projection matrix stack.
GL_TEXTURE
Applies subsequent matrix operations to the texture matrix stack.
GL_COLOR
Applies subsequent matrix operations to the color matrix stack.
To find out which matrix stack is currently the target of all matrix operations, call glGet with argument GL_MATRIX_MODE . The initial value is GL_MODELVIEW .

Errors

GL_INVALID_ENUM is generated if mode is not an accepted value.
GL_INVALID_OPERATION is generated if glMatrixMode is executed between the execution of glBegin and the corresponding execution of glEnd .

Associated Gets

glGet with argument GL_MATRIX_MODE

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.

glMatrixMode
OpenGLContext tests/gldrawpixelssynth.py Lines: 45, 52, 66, 71
OpenGLContext tests/shadow_1.py Lines: 288, 392, 394
OpenGLContext tests/glhistogram.py Lines: 52, 59, 82, 87
OpenGLContext tests/boundingvolume.py Lines: 70, 72, 100
OpenGLContext tests/gldrawpixels.py Lines: 65, 72, 86, 91
OpenGLContext tests/glutbitmapcharacter.py Lines: 14, 21, 34, 39
OpenGLContext OpenGLContext/context.py Lines: 537
OpenGLContext OpenGLContext/atlas.py Lines: 253, 255
OpenGLContext OpenGLContext/framecounter.py Lines: 61, 64
OpenGLContext OpenGLContext/doinchildmatrix.py Lines: 19, 27, 33
OpenGLContext OpenGLContext/shadow/shadowcontext.py Lines: 20, 23
OpenGLContext OpenGLContext/move/viewplatform.py Lines: 137, 141
OpenGLContext OpenGLContext/scenegraph/texturetransform.py Lines: 44, 56, 59, 66
OpenGLContext OpenGLContext/scenegraph/imagetexture.py Lines: 101, 105
OpenGLContext OpenGLContext/passes/renderpass.py Lines: 296, 541
OpenGLContext OpenGLContext/passes/rendervisitor.py Lines: 257, 321, 323, 400, 418
OpenGLContext OpenGLContext/passes/flat.py Lines: 332, 342, 346, 433, 535
OpenGL-Demo PyOpenGL-Demo/redbook/smooth.py Lines: 87, 93
OpenGL-Demo PyOpenGL-Demo/redbook/double.py Lines: 90, 93
OpenGL-Demo PyOpenGL-Demo/redbook/movelight.py Lines: 113, 116
OpenGL-Demo PyOpenGL-Demo/redbook/fog.py Lines: 117, 123
OpenGL-Demo PyOpenGL-Demo/redbook/cube.py Lines: 78, 81
OpenGL-Demo PyOpenGL-Demo/redbook/teapots.py Lines: 182, 188
OpenGL-Demo PyOpenGL-Demo/redbook/lines.py Lines: 122
OpenGL-Demo PyOpenGL-Demo/redbook/hello.py Lines: 82
OpenGL-Demo PyOpenGL-Demo/redbook/drawf.py Lines: 92, 95
OpenGL-Demo PyOpenGL-Demo/redbook/scene.py Lines: 109, 117
OpenGL-Demo PyOpenGL-Demo/da/dots.py Lines: 88
OpenGL-Demo PyOpenGL-Demo/GLUT/molehill.py Lines: 132, 134
OpenGL-Demo PyOpenGL-Demo/GLUT/shader_test.py Lines: 31, 36, 73, 76
OpenGL-Demo PyOpenGL-Demo/GLUT/glutplane.py Lines: 240, 242
OpenGL-Demo PyOpenGL-Demo/GLUT/gears.py Lines: 207, 210
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/text.py Lines: 53, 64
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/arraytest.py Lines: 64, 69
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/lorentz.py Lines: 70, 79
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/cone.py Lines: 62, 73
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/checker.py Lines: 63, 74
OpenGL-Demo PyOpenGL-Demo/proesch/nurbs/nurbs.py Lines: 140, 144
OpenGL-Demo PyOpenGL-Demo/proesch/stereo/stereoDemo.py Lines: 62, 65
OpenGL-Demo PyOpenGL-Demo/proesch/bezier/bezier.py Lines: 87, 91
OpenGL-Demo PyOpenGL-Demo/GLE/maintest.py Lines: 51, 54
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson5.py Lines: 68, 73, 81, 84
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson45.py Lines: 375, 381
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson18.py Lines: 114, 119, 134, 137
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson4.py Lines: 65, 70, 78, 81
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson12.py Lines: 46, 51, 59, 62
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson26.py Lines: 71, 76, 84, 87
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson41.py Lines: 207, 213
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson13.py Lines: 132, 138
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson2.py Lines: 55, 60, 68, 71
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson11.py Lines: 50, 55, 63, 66
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson19.py Lines: 117, 122, 130, 133
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson1.py Lines: 55, 60, 68, 71
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson3.py Lines: 55, 60, 68, 71
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson23.py Lines: 70, 75, 83, 86
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6.py Lines: 90, 95, 103, 106
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson16.py Lines: 55, 60, 68, 71
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson42.py Lines: 273, 281, 289, 297, 302, 364, 370
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6-multi.py Lines: 124, 129, 137, 140
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson43/glFreeType.py Lines: 189, 201, 272
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson43/lesson43.py Lines: 87, 93
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson44/lesson44.py Lines: 215, 222
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson44/glFont.py Lines: 75, 79, 87, 89
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson48/NeHeGL.py Lines: 92, 99
Glinter Widget.py Lines: 54, 57, 101, 584, 588, 592, 597, 663, 669, 673, 674
{Artistic License} PymmLib applications/glutviewer.py Lines: 163, 175
{Artistic License} PymmLib mmLib/OpenGLDriver.py Lines: 138, 150
pyBzEdit pyBzEdit.py Lines: 419, 425, 761, 777, 808, 810
{LGPL} PyUI tests/testcube.py Lines: 45
{LGPL} PyUI pyui/renderers/openglPygame.py Lines: 181, 185, 193, 195
{LGPL} PyUI pyui/renderers/openglBase.py Lines: 307, 312, 326, 328, 331, 343
{LGPL} PyUI pyui/renderers/openglGlut.py Lines: 230, 233
{LGPL} PyUI2 system/openglgraphics.py Lines: 185, 190, 204, 206, 209, 212
{LGPL} PyUI2 system/glutdevice.py Lines: 171, 174
{LGPL} PyUI2 renderers/openglPygame.py Lines: 184, 188, 196, 198
{LGPL} PyUI2 renderers/openglBase.py Lines: 307, 312, 326, 328, 331, 343
{LGPL} PyUI2 renderers/openglGlut.py Lines: 230, 233
{LGPL} VisionEgg VisionEgg/SphereMap.py Lines: 251, 528, 834, 1070, 1209
{LGPL} VisionEgg VisionEgg/Text.py Lines: 256, 320
{LGPL} VisionEgg VisionEgg/Textures.py Lines: 1394, 1724, 1848
{LGPL} VisionEgg VisionEgg/MoreStimuli.py Lines: 111, 307
{LGPL} VisionEgg VisionEgg/Gratings.py Lines: 328
{LGPL} VisionEgg VisionEgg/Core.py Lines: 564, 799, 804, 809, 814, 820, 833, 846, 883, 1083
{LGPL} VisionEgg VisionEgg/Dots.py Lines: 238
{LGPL} VisionEgg test/conform.py Lines: 156, 215
{LGPL} PyMT examples/apps/3Dviewer/3Dviewer.py Lines: 45, 50, 57, 59, 61, 81, 153
{LGPL} PyMT examples/apps/3Ddrawing/3Ddrawing.py Lines: 36, 41, 48, 50, 52, 100, 108
{LGPL} PyMT pymt/ui/window/__init__.py Lines: 19, 454, 466
{LGPL} PyMT pymt/graphx/statement.py Lines: 54, 175, 181
{GPL} GLChess src/lib/scene/opengl/opengl.py Lines: 359, 367, 425, 430, 454, 553, 564
{LGPL} Pyggel pyggel/data.py Lines: 548, 552, 610, 614
{LGPL} Pyggel pyggel/view.py Lines: 280, 285, 299, 303
{LGPL} pygl2d pygl2d/window.py Lines: 69, 73, 78, 80
{GPL} Scocca scocca/graphics/opengl/matrix.py Lines: 29
{LGPL or GPL or MPL} Kamaelia Code/Python/Kamaelia/Kamaelia/UI/OpenGL/OpenGLDisplay.py Lines: 478, 753, 769, 778, 789, 859
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Utils/Particles3D.py Lines: 248, 289, 313, 317, 332, 334, 337
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Utils/TopologyViewer3D.py Lines: 639
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Experiments/Spheres.py Lines: 20, 23
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Experiments/Cubes.py Lines: 36, 43, 298, 308, 316, 319
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Examples/simplecube/simplecube.py Lines: 21, 25
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/OpenGLDisplay.py Lines: 478, 754, 770, 779, 790, 860
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Sketches/PygameWrapperPlane.py Lines: 141
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Sketches/Button3D.py Lines: 177
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Sketches/TexPlane.py Lines: 133
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Sketches/Scrollbar3D.py Lines: 161
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Sketches/Display3D.py Lines: 145
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Sketches/Progress3D.py Lines: 136
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Sketches/Object3D.py Lines: 119
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Sketches/SimpleCube.py Lines: 135
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Sketches/playground/Display3D.py Lines: 150, 411, 455, 463, 474
{LGPL or GPL or MPL} Kamaelia Sketches/THF/3D/PygameWrapperPlane.py Lines: 141
{LGPL or GPL or MPL} Kamaelia Sketches/THF/3D/Button3D.py Lines: 177
{LGPL or GPL or MPL} Kamaelia Sketches/THF/3D/TexPlane.py Lines: 133
{LGPL or GPL or MPL} Kamaelia Sketches/THF/3D/Scrollbar3D.py Lines: 161
{LGPL or GPL or MPL} Kamaelia Sketches/THF/3D/Display3D.py Lines: 145
{LGPL or GPL or MPL} Kamaelia Sketches/THF/3D/Progress3D.py Lines: 136
{LGPL or GPL or MPL} Kamaelia Sketches/THF/3D/Object3D.py Lines: 119
{LGPL or GPL or MPL} Kamaelia Sketches/THF/3D/SimpleCube.py Lines: 135
{LGPL or GPL or MPL} Kamaelia Sketches/THF/3D/playground/Display3D.py Lines: 150, 411, 455, 463, 474
{LGPL or GPL or MPL} Kamaelia Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/OpenGLDisplay.py Lines: 478, 753, 769, 778, 789, 859
{LGPL or GPL or MPL} Kamaelia Sketches/THF/simplecube/simplecube_controlled.py Lines: 73, 77
{LGPL or GPL or MPL} Kamaelia Sketches/THF/simplecube/simplecube.py Lines: 21, 25
{LGPL or GPL or MPL} Kamaelia Sketches/MPS/Old/SoC/simplecube.py Lines: 49, 53
Gloopy gloopy/view/modelview.py Lines: 24, 32
Gloopy gloopy/view/projection.py Lines: 39, 65, 75
Visvis core/baseFigure.py Lines: 868, 871
Visvis core/cameras.py Lines: 649, 660, 1105, 1123, 1723, 1738
Visvis core/axes.py Lines: 827, 830, 919, 922, 946, 949, 962, 965, 984, 987, 1044, 1048
Previous: glMaterial Table of Contents (GL) Next: glMemoryBarrier