1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!DOCTYPE book PUBLIC
"-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
3 "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
4 <refentry id=
"glScale">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glScale
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glScale
</refname>
17 <refpurpose>multiply the current matrix by a general scaling matrix
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glScaled
</function></funcdef>
23 <paramdef>GLdouble
<parameter>x
</parameter></paramdef>
24 <paramdef>GLdouble
<parameter>y
</parameter></paramdef>
25 <paramdef>GLdouble
<parameter>z
</parameter></paramdef>
30 <funcdef>void
<function>glScalef
</function></funcdef>
31 <paramdef>GLfloat
<parameter>x
</parameter></paramdef>
32 <paramdef>GLfloat
<parameter>y
</parameter></paramdef>
33 <paramdef>GLfloat
<parameter>z
</parameter></paramdef>
37 <!-- eqn: ignoring delim $$ -->
38 <refsect1 id=
"parameters"><title>Parameters
</title>
41 <term><parameter>x
</parameter></term>
42 <term><parameter>y
</parameter></term>
43 <term><parameter>z
</parameter></term>
46 Specify scale factors along the
<emphasis>x
</emphasis>,
<emphasis>y
</emphasis>, and
<emphasis>z
</emphasis> axes, respectively.
52 <refsect1 id=
"description"><title>Description
</title>
54 <function>glScale
</function> produces a nonuniform scaling along the
<emphasis>x
</emphasis>,
<emphasis>y
</emphasis>, and
55 <emphasis>z
</emphasis> axes.
56 The three parameters indicate the desired scale factor along
57 each of the three axes.
61 (see
<citerefentry><refentrytitle>glMatrixMode
</refentrytitle></citerefentry>)
62 is multiplied by this scale matrix,
63 and the product replaces the current matrix
64 as if
<citerefentry><refentrytitle>glMultMatrix
</refentrytitle></citerefentry> were called with the following matrix
68 <informalequation><mml:math>
69 <!-- eqn: left ( matrix { ccol { x above 0 above 0 above 0 } ccol { 0 above y above 0 above 0 } ccol { 0 above 0 above z above 0 } ccol { 0 above 0 above 0 above 1} } right ):-->
70 <mml:mfenced open=
"(" close=
")">
74 <mml:mi mathvariant=
"italic">x
</mml:mi>
91 <mml:mi mathvariant=
"italic">y
</mml:mi>
108 <mml:mi mathvariant=
"italic">z
</mml:mi>
130 </mml:math></informalequation>
133 If the matrix mode is either
<constant>GL_MODELVIEW
</constant> or
<constant>GL_PROJECTION
</constant>,
134 all objects drawn after
<function>glScale
</function> is called are scaled.
137 Use
<citerefentry><refentrytitle>glPushMatrix
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glPopMatrix
</refentrytitle></citerefentry> to save and restore
138 the unscaled coordinate
142 <refsect1 id=
"notes"><title>Notes
</title>
144 If scale factors other than
1 are applied to the modelview matrix
145 and lighting is enabled, lighting often appears wrong.
146 In that case, enable automatic normalization of normals by
147 calling
<citerefentry><refentrytitle>glEnable
</refentrytitle></citerefentry> with the argument
<constant>GL_NORMALIZE
</constant>.
150 <refsect1 id=
"errors"><title>Errors
</title>
152 <constant>GL_INVALID_OPERATION
</constant> is generated if
<function>glScale
</function>
153 is executed between the execution of
154 <citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
155 and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
158 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
160 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MATRIX_MODE
</constant>
163 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_COLOR_MATRIX
</constant>
166 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MODELVIEW_MATRIX
</constant>
169 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_PROJECTION_MATRIX
</constant>
172 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_MATRIX
</constant>
175 <refsect1 id=
"seealso"><title>See Also
</title>
177 <citerefentry><refentrytitle>glMatrixMode
</refentrytitle></citerefentry>,
178 <citerefentry><refentrytitle>glMultMatrix
</refentrytitle></citerefentry>,
179 <citerefentry><refentrytitle>glPushMatrix
</refentrytitle></citerefentry>,
180 <citerefentry><refentrytitle>glRotate
</refentrytitle></citerefentry>,
181 <citerefentry><refentrytitle>glTranslate
</refentrytitle></citerefentry>
184 <refsect1 id=
"Copyright"><title>Copyright
</title>
186 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
187 Silicon Graphics, Inc. This document is licensed under the SGI
188 Free Software B License. For details, see
189 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.