2.0 3.0 > comp > gb.opengl > gl > translatef

 文档

Gl.Translatef (gb.opengl)
`Static Sub Translatef ( X As Float, Y As Float, Z As Float )`

Multiply the current matrix by a translation matrix.

### Parameters

x, y, z

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

### Description

Gl.Translate produces a translation by $\left(\mathit{x},\mathit{y},\mathit{z}\right)$. The current matrix (see Gl.MatrixMode) is multiplied by this translation matrix, with the product replacing the current matrix, as if Gl.MultMatrix were called with the following matrix for its argument:

$\left(\begin{array}{cccc}1& 0& 0& \mathit{x}\\ 0& 1& 0& \mathit{y}\\ 0& 0& 1& \mathit{z}\\ 0& 0& 0& 1\end{array}\right)$

If the matrix mode is either Gl.MODELVIEW or Gl.PROJECTION, all objects drawn after a call to Gl.Translate are translated.

Use Gl.PushMatrix and Gl.PopMatrix to save and restore the untranslated coordinate system.

### Errors

Gl.INVALID_OPERATION is generated if Gl.Translate is executed between the execution of Gl.Begin and the corresponding execution of Gl.End.

### Associated Gets

Gl.Get with argument Gl.MATRIX_MODE

Gl.Get with argument Gl.COLOR_MATRIX

Gl.Get with argument Gl.MODELVIEW_MATRIX

Gl.Get with argument Gl.PROJECTION_MATRIX

Gl.Get with argument Gl.TEXTURE_MATRIX

### 参见

Gl.MatrixMode, Gl.MultMatrix, Gl.PushMatrix, Gl.Rotate, Gl.Scale