scale(3G) scale(3G)
NAME
scale - scales and mirrors the current matrix
C SPECIFICATION
void scale(x, y, z)
float x, y, z;
PARAMETERS
x expects the scale factor in the x direction.
y expects the scale factor in the y direction.
z expects the scale factor in the z direction.
DESCRIPTION
scale modifies the current matrix, causing it to shrink, expand, or
mirror coordinates that it transforms. Values with a magnitude greater
than 1 result in expansion; values with a magnitude less than 1 cause
shrinkage. Negative values result in mirrored coordinates.
The x, y, and z scale factors are used to compute a 4x4 scale matrix,
which then premultiplies the current matrix, as specified by mmode. Thus
if T is the current matrix, and S is the matrix computed by scale, T is
replaced with S*T.
The current matrix is the top matrix on the transformation stack if mmode
is MSINGLE, the top matrix on the ModelView matrix stack if mmode is
MVIEWING, the Projection matrix if mmode is MPROJECTION, or the Texture
matrix if mmode is MTEXTURE.
All objects drawn after scale is called while mmode is either MSINGLE or
MVIEWING are scaled. Use pushmatrix and popmatrix to preserve and
restore the unscaled coordinate system.
SEE ALSO
mmode, popmatrix, pushmatrix, rotate, translate
NOTES
Matrices that negate coordinates, such as scale (-1.0, 1.0, 1.0), reverse
the directional order of a polygon's points and can cause the opposite of
what is intended.
Page 1