/ comp / gb.opengl / gl / rotatef
Gl.Rotatef (gb.opengl)
Syntax

    STATIC SUB Rotatef ( Angle AS Float, X AS Float, Y AS Float, Z AS Float )

### Multiply the current matrix by a rotation matrix

#### Parameters

- Angle specifies the angle of rotation, in degrees.

- X, Y, Z specify the x, y, and z coordinates of a vector, respectively.

#### Description

Gl.Rotate computes a matrix that performs a counterclockwise rotation of angle degrees about the vector from the origin through the point (x, y, z).

The current matrix (see Gl.MatrixMode) is multiplied by this rotation matrix, with the product replacing the current matrix. That is, if M is the current matrix and R is the rotation matrix, then M is replaced with M * R. If the matrix mode is either Gl.GL_MODELVIEW or Gl.GL_PROJECTION, all objects drawn after Gl.Rotate is called are rotated. Use Gl.PushMatrix and Gl.PopMatrix to save and restore the unrotated coordinate system.

#### Errors

Gl.GL_INVALID_OPERATION is generated if Gl.Rotate is called between a call to Gl.Begin and the corresponding call to Gl.End.

#### Associated Gets

Gl.GetMatrixMode
Gl.GetModelviewMatrix
Gl.GetProjectionMatrix
Gl.GetTextureMatrix

### See also

Gl.MatrixMode, Gl.MultMatrix, Gl.PushMatrix , Gl.Scalef, Gl.Translatef