Gl.Scalef (gb.opengl)

Static Sub Scalef ( X As Float, Y As Float, Z As Float )

Multiply the current matrix by a general scaling matrix.

Parameters

x, y, z

Specify scale factors along the x, y, and z axes, respectively.

Description

Gl.Scale produces a nonuniform scaling along the x, y, and z axes. The three parameters indicate the desired scale factor along each of the three axes.

The current matrix (see Gl.MatrixMode) is multiplied by this scale matrix, and the product replaces the current matrix as if Gl.MultMatrix were called with the following matrix as its argument:

x 0 0 0 0 y 0 0 0 0 z 0 0 0 0 1

If the matrix mode is either Gl.MODELVIEW or Gl.PROJECTION, all objects drawn after Gl.Scale is called are scaled.

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

Notes

If scale factors other than 1 are applied to the modelview matrix and lighting is enabled, lighting often appears wrong. In that case, enable automatic normalization of normals by calling Gl.Enable with the argument Gl.NORMALIZE.

Errors

Gl.INVALID_OPERATION is generated if Gl.Scale 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

See also

Gl.MultMatrix, Gl.PushMatrix, Gl.Rotate, Gl.Translate

See original documentation on OpenGL website