glTranslate

multiply the current matrix by a translation matrix

Signature

glTranslate( )->
glTranslate( x , y , z )
glTranslated( GLdouble ( x ) , GLdouble ( y ) , GLdouble ( z ) )-> void
glTranslated( x , y , z )
glTranslatef( GLfloat ( x ) , GLfloat ( y ) , GLfloat ( z ) )-> void
glTranslatef( x , y , z )

Parameters

VariablesDescription
x, y, z
Specify the x , y , and z coordinates of a translation vector.

Description

glTranslate produces a translation by x y z . The current matrix (see glMatrixMode ) is multiplied by this translation matrix, with the product replacing the current matrix, as if glMultMatrix were called with the following matrix for its argument:
1 0 0 x 0 1 0 y 0 0 1 z 0 0 0 1
If the matrix mode is either GL_MODELVIEW or GL_PROJECTION , all objects drawn after a call to glTranslate are translated.
Use glPushMatrix and glPopMatrix to save and restore the untranslated coordinate system.

Errors

GL_INVALID_OPERATION is generated if glTranslate 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.

glTranslate
OpenGLContext OpenGLContext/scenegraph/text/font.py Lines: 392, 394, 406, 408, 419, 421
OpenGLContext OpenGLContext/scenegraph/text/toolsfont.py Lines: 38, 335, 337
OpenGLContext OpenGLContext/move/viewplatform.py Lines: 146
OpenGLContext OpenGLContext/shadow/volume.py Lines: 329
OpenGLContext OpenGLContext/shadow/shadowcontext.py Lines: 26
OpenGLContext tests/shaders.py Lines: 29, 31
OpenGLContext tests/_bitmap_font.py Lines: 45, 50, 52, 64, 66, 79, 81
OpenGLContext tests/arbwindowpos.py Lines: 86
OpenGLContext tests/glut_font.py Lines: 28, 32, 34
OpenGLContext tests/wgl_font.py Lines: 49
OpenGLContext tests/solid_font.py Lines: 70
OpenGL-Demo PyOpenGL-Demo/GLUT/shader_test.py Lines: 90
OpenGL-Demo py2exe-example/shader_test.py Lines: 91
{LGPL} PyUI2 renderers/openglBase.py Lines: 226
{LGPL} PyUI2 renderers/openglPygame.py Lines: 316, 320
{LGPL} PyUI2 system/openglgraphics.py Lines: 368, 372
{LGPL} VisionEgg VisionEgg/MoreStimuli.py Lines: 113, 317
{LGPL} VisionEgg VisionEgg/Gratings.py Lines: 332
{LGPL} VisionEgg VisionEgg/Textures.py Lines: 1472, 1801
{LGPL} VisionEgg VisionEgg/Text.py Lines: 416, 480
{LGPL} PyMT pymt/core/svg/__init__.py Lines: 11, 172, 174
{LGPL or GPL or MPL} Kamaelia Code/Python/Kamaelia/Examples/OpenGL/Checkers/CheckersPiece.py Lines: 56
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Examples/simplecube/simplecube.py Lines: 61
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/THF/Examples/Checkers/CheckersPiece.py Lines: 56
{LGPL or GPL or MPL} Kamaelia Sketches/MPS/Examples/Checkers/CheckersPiece.py Lines: 56
{LGPL or GPL or MPL} Kamaelia Sketches/MPS/Old/SoC/simplecube.py Lines: 98
{LGPL or GPL or MPL} Kamaelia Sketches/THF/simplecube/simplecube_controlled.py Lines: 121
{LGPL or GPL or MPL} Kamaelia Sketches/THF/simplecube/simplecube.py Lines: 61
{LGPL or GPL or MPL} Kamaelia Sketches/THF/Packages/Examples/Checkers/CheckersPiece.py Lines: 56
Visvis core/cameras.py Lines: 707, 1153, 1175, 1793
Visvis core/base.py Lines: 810
{GPL3} OpenGL-Programmable 05-shader.py Lines: 127, 220
{GPL3} OpenGL-Programmable 07-attrib.py Lines: 144, 239
{GPL3} OpenGL-Programmable 03-array.py Lines: 60, 135
{GPL3} OpenGL-Programmable 06-perpixel.py Lines: 135, 228
{GPL3} OpenGL-Programmable 02-displaylist.py Lines: 60, 133
{GPL3} OpenGL-Programmable 04-vbo.py Lines: 61, 154
{GPL3} OpenGL-Programmable 01-direct.py Lines: 60, 124
{GPL3} OpenGL-Programmable 08-pbo.py Lines: 155, 261
glTranslated
OpenGLContext OpenGLContext/wxcontext.py Lines: 345
OpenGLContext OpenGLContext/pygamecontext.py Lines: 149
OpenGLContext OpenGLContext/glutinteractivecontext.py Lines: 17, 21
OpenGLContext OpenGLContext/framecounter.py Lines: 68
OpenGLContext OpenGLContext/wxinteractivecontext.py Lines: 19, 23
OpenGLContext OpenGLContext/scenegraph/transform.py Lines: 26, 28, 55
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson44/glFont.py Lines: 65, 82
OpenGL-Demo PyOpenGL-Demo/redbook/movelight.py Lines: 102
{LGPL} PyMT examples/games/untangle/graph.py Lines: 13, 27
{LGPL} PyMT examples/framework/animation/animation.py Lines: 16, 18
glTranslatef
OpenGLContext OpenGLContext/scenegraph/texturetransform.py Lines: 24, 27, 34
OpenGLContext tests/nehe6_multi.py Lines: 76
OpenGLContext tests/nehe5.py Lines: 26, 32
OpenGLContext tests/nehe6_compressed.py Lines: 48
OpenGLContext tests/readpixelsleak.py Lines: 19
OpenGLContext tests/glarrayelement.py Lines: 15
OpenGLContext tests/nehe8.py Lines: 82
OpenGLContext tests/nehe6_convolve.py Lines: 138
OpenGLContext tests/nehe2.py Lines: 46, 55
OpenGLContext tests/redbook_alpha3D.py Lines: 126, 133
OpenGLContext tests/nehe7.py Lines: 139
OpenGLContext tests/glut_fullscreen.py Lines: 21
OpenGLContext tests/nehe3.py Lines: 33, 43
OpenGLContext tests/saveimage.py Lines: 35
OpenGLContext tests/glinterleavedarrays.py Lines: 12, 28
OpenGLContext tests/nehe6_timer.py Lines: 81
OpenGLContext tests/nehe6.py Lines: 67
OpenGLContext tests/nehe4.py Lines: 43, 65
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson11.py Lines: 81
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson18.py Lines: 190, 206, 216
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6.py Lines: 116
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson41.py Lines: 226
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson16.py Lines: 99
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson23.py Lines: 146, 160, 170, 183
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson5.py Lines: 94, 132
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson4.py Lines: 94, 114
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson26.py Lines: 146, 169, 189
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson12.py Lines: 120
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson3.py Lines: 82, 97
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson13.py Lines: 150
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson42.py Lines: 312, 323, 338, 344
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson2.py Lines: 82, 93
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6-multi.py Lines: 153
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson45.py Lines: 403
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson44/lesson44.py Lines: 194, 361
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson44/glCamera.py Lines: 696, 758
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson43/lesson43.py Lines: 106, 124
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson43/glFreeType.py Lines: 124, 172, 294
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson48/Lesson48.py Lines: 130, 139
OpenGL-Demo PyOpenGL-Demo/proesch/nurbs/nurbs.py Lines: 150, 161
OpenGL-Demo PyOpenGL-Demo/GLE/texas.py Lines: 46
OpenGL-Demo PyOpenGL-Demo/GLE/helix.py Lines: 18
OpenGL-Demo PyOpenGL-Demo/GLE/cone.py Lines: 20
OpenGL-Demo PyOpenGL-Demo/GLUT/gears.py Lines: 145, 151, 157, 217
OpenGL-Demo PyOpenGL-Demo/GLUT/shader_test.py Lines: 85
OpenGL-Demo PyOpenGL-Demo/GLUT/glutplane.py Lines: 65, 69
OpenGL-Demo PyOpenGL-Demo/GLUT/molehill.py Lines: 135
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/checker.py Lines: 44
OpenGL-Demo PyOpenGL-Demo/GLUT/tom/cone.py Lines: 25
OpenGL-Demo PyOpenGL-Demo/redbook/scene.py Lines: 89, 95, 101
OpenGL-Demo PyOpenGL-Demo/redbook/fog.py Lines: 99
OpenGL-Demo PyOpenGL-Demo/redbook/teapots.py Lines: 105
OpenGL-Demo PyOpenGL-Demo/tom/pick.py Lines: 20
OpenGL-Demo PyOpenGL-Demo/tom/conechecker.py Lines: 26, 49
OpenGL-Demo PyOpenGL-Demo/tom/conesave.py Lines: 30
OpenGL-Demo PyOpenGL-Demo/tom/checker.py Lines: 26
OpenGL-Demo PyOpenGL-Demo/tom/fog.py Lines: 57
OpenGL-Demo PyOpenGL-Demo/tom/cone.py Lines: 27
OpenGL-Demo py2exe-example/shader_test.py Lines: 86
{Artistic License} PymmLib pymmlib/applications/glutviewer.py Lines: 230
{Artistic License} PymmLib pymmlib/mmLib/OpenGLDriver.py Lines: 159, 229, 245, 250, 504, 569
{LGPL} PyUI2 renderers/openglBase.py Lines: 345
{LGPL} PyUI2 system/openglgraphics.py Lines: 214
{LGPL} VisionEgg VisionEgg/Core.py Lines: 812, 878
{LGPL} VisionEgg VisionEgg/Textures.py Lines: 1883
{LGPL} VisionEgg test/conform.py Lines: 175, 217, 220
{LGPL} PyMT examples/apps/3Ddrawing/3Ddrawing.py Lines: 44
{LGPL} PyMT examples/apps/3Dviewer/3Dviewer.py Lines: 53
{LGPL} PyMT examples/apps/pictures/pictures.py Lines: 30
{LGPL} PyMT examples/desktop/desktop-multi.py Lines: 6, 81, 134
{LGPL} PyMT pymt/ui/window/__init__.py Lines: 20, 463, 468, 470
{LGPL} PyMT pymt/ui/widgets/objectdisplay.py Lines: 7, 38
{LGPL} PyMT pymt/ui/widgets/coverflow.py Lines: 7, 272, 317
{LGPL} PyMT pymt/ui/widgets/buttonmatrix.py Lines: 7, 76
{LGPL} PyMT pymt/ui/widgets/speechbubble.py Lines: 11, 99
{LGPL} PyMT pymt/ui/widgets/flippable.py Lines: 8, 136, 137, 142
{LGPL} PyMT pymt/ui/widgets/circularslider.py Lines: 8, 148
{LGPL} PyMT pymt/ui/widgets/klist.py Lines: 13, 40
{LGPL} PyMT pymt/ui/widgets/composed/vkeyboard.py Lines: 16, 499
{LGPL} PyMT pymt/graphx/draw.py Lines: 227, 567, 590
{LGPL} PyMT pymt/lib/squirtle.py Lines: 16, 490, 499
{LGPL} Pyggel pyggel/image.py Lines: 92, 159
{LGPL} Pyggel pyggel/misc.py Lines: 214, 325
{LGPL} Pyggel pyggel/camera.py Lines: 61, 101, 105
{LGPL} Pyggel pyggel/geometry.py Lines: 140, 295, 445, 574
{LGPL} Pyggel pyggel/font.py Lines: 311, 518, 951, 992
{LGPL} Pyggel pyggel/mesh.py Lines: 211, 302, 759
{LGPL} pygl2d pygl2d/display.py Lines: 81
{LGPL} pygl2d pygl2d/image.py Lines: 168
{LGPL} pygl2d pygl2d/draw.py Lines: 149
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Experiments/Cubes.py Lines: 179
{LGPL or GPL or MPL} Kamaelia Sketches/CL/Topology3D/Experiments/Spheres.py Lines: 118
Gloopy gloopy/view/render.py Lines: 130
Visvis text/text_freetype.py Lines: 580
Visvis text/text_prerendered.py Lines: 182
Visvis core/base.py Lines: 610

MathML Rendering

Powered by MathJax