glTranslate produces a translation by (𝐱, 𝐲, 𝐳). 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ㅤ𝐱⎞
⎜0ㅤ1ㅤ0ㅤ𝐲 ⎜
⎜0ㅤ0ㅤ1ㅤ𝐳 ⎜
⎝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.
glTranslate
produces a translation by (𝐱, 𝐲, 𝐳). 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ㅤ𝐱⎞
⎜0ㅤ1ㅤ0ㅤ𝐲 ⎜
⎜0ㅤ0ㅤ1ㅤ𝐳 ⎜
⎝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.