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=
"glRotate">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glRotate
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glRotate
</refname>
17 <refpurpose>multiply the current matrix by a rotation matrix
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glRotated
</function></funcdef>
23 <paramdef>GLdouble
<parameter>angle
</parameter></paramdef>
24 <paramdef>GLdouble
<parameter>x
</parameter></paramdef>
25 <paramdef>GLdouble
<parameter>y
</parameter></paramdef>
26 <paramdef>GLdouble
<parameter>z
</parameter></paramdef>
31 <funcdef>void
<function>glRotatef
</function></funcdef>
32 <paramdef>GLfloat
<parameter>angle
</parameter></paramdef>
33 <paramdef>GLfloat
<parameter>x
</parameter></paramdef>
34 <paramdef>GLfloat
<parameter>y
</parameter></paramdef>
35 <paramdef>GLfloat
<parameter>z
</parameter></paramdef>
39 <!-- eqn: ignoring delim $$ -->
40 <refsect1 id=
"parameters"><title>Parameters
</title>
43 <term><parameter>angle
</parameter></term>
46 Specifies the angle of rotation, in degrees.
51 <term><parameter>x
</parameter></term>
52 <term><parameter>y
</parameter></term>
53 <term><parameter>z
</parameter></term>
56 Specify the
<emphasis>x
</emphasis>,
<emphasis>y
</emphasis>, and
<emphasis>z
</emphasis> coordinates of a vector, respectively.
62 <refsect1 id=
"description"><title>Description
</title>
64 <function>glRotate
</function> produces a rotation of
<parameter>angle
</parameter> degrees around
66 <inlineequation><mml:math>
67 <!-- eqn: (x, y, z):-->
68 <mml:mfenced open=
"(" close=
")">
69 <mml:mi mathvariant=
"italic">x
</mml:mi>
70 <mml:mi mathvariant=
"italic">y
</mml:mi>
71 <mml:mi mathvariant=
"italic">z
</mml:mi>
73 </mml:math></inlineequation>.
74 The current matrix (see
<citerefentry><refentrytitle>glMatrixMode
</refentrytitle></citerefentry>) is multiplied by a rotation
75 matrix with the product
76 replacing the current matrix, as if
<citerefentry><refentrytitle>glMultMatrix
</refentrytitle></citerefentry> were called
77 with the following matrix as its argument:
80 <informalequation><mml:math>
81 <!-- eqn: left ( matrix { ccol { x sup 2 (1 - c) + c above y x (1 - c) + z s above x z (1 - c) - y s above 0 } ccol { x y (1 - c) - z s above y sup 2 (1 - c) + c above y z (1 - c) + x s above 0 } ccol { x z (1 - c) + y s above y z (1 - c) - x s above z sup 2 (1 - c) + c above 0 } ccol { 0 above 0 above 0 above 1} } right ):-->
82 <mml:mfenced open=
"(" close=
")">
88 <mml:msup><mml:mi mathvariant=
"italic">x
</mml:mi>
92 <mml:mfenced open=
"(" close=
")">
96 <mml:mi mathvariant=
"italic">c
</mml:mi>
101 <mml:mi mathvariant=
"italic">c
</mml:mi>
106 <mml:mi mathvariant=
"italic">x
</mml:mi>
107 <mml:mo>⁢</mml:mo>
109 <mml:mi mathvariant=
"italic">y
</mml:mi>
110 <mml:mo>⁡</mml:mo>
111 <mml:mfenced open=
"(" close=
")">
115 <mml:mi mathvariant=
"italic">c
</mml:mi>
120 <mml:mi mathvariant=
"italic">z
</mml:mi>
121 <mml:mo>⁢</mml:mo>
122 <mml:mi mathvariant=
"italic">s
</mml:mi>
127 <mml:mi mathvariant=
"italic">x
</mml:mi>
128 <mml:mo>⁢</mml:mo>
130 <mml:mi mathvariant=
"italic">z
</mml:mi>
131 <mml:mo>⁡</mml:mo>
132 <mml:mfenced open=
"(" close=
")">
136 <mml:mi mathvariant=
"italic">c
</mml:mi>
141 <mml:mi mathvariant=
"italic">y
</mml:mi>
142 <mml:mo>⁢</mml:mo>
143 <mml:mi mathvariant=
"italic">s
</mml:mi>
153 <mml:mi mathvariant=
"italic">y
</mml:mi>
154 <mml:mo>⁢</mml:mo>
156 <mml:mi mathvariant=
"italic">x
</mml:mi>
157 <mml:mo>⁡</mml:mo>
158 <mml:mfenced open=
"(" close=
")">
162 <mml:mi mathvariant=
"italic">c
</mml:mi>
167 <mml:mi mathvariant=
"italic">z
</mml:mi>
168 <mml:mo>⁢</mml:mo>
169 <mml:mi mathvariant=
"italic">s
</mml:mi>
175 <mml:msup><mml:mi mathvariant=
"italic">y
</mml:mi>
178 <mml:mo>⁡</mml:mo>
179 <mml:mfenced open=
"(" close=
")">
183 <mml:mi mathvariant=
"italic">c
</mml:mi>
188 <mml:mi mathvariant=
"italic">c
</mml:mi>
193 <mml:mi mathvariant=
"italic">y
</mml:mi>
194 <mml:mo>⁢</mml:mo>
196 <mml:mi mathvariant=
"italic">z
</mml:mi>
197 <mml:mo>⁡</mml:mo>
198 <mml:mfenced open=
"(" close=
")">
202 <mml:mi mathvariant=
"italic">c
</mml:mi>
207 <mml:mi mathvariant=
"italic">x
</mml:mi>
208 <mml:mo>⁢</mml:mo>
209 <mml:mi mathvariant=
"italic">s
</mml:mi>
219 <mml:mi mathvariant=
"italic">x
</mml:mi>
220 <mml:mo>⁢</mml:mo>
222 <mml:mi mathvariant=
"italic">z
</mml:mi>
223 <mml:mo>⁡</mml:mo>
224 <mml:mfenced open=
"(" close=
")">
228 <mml:mi mathvariant=
"italic">c
</mml:mi>
233 <mml:mi mathvariant=
"italic">y
</mml:mi>
234 <mml:mo>⁢</mml:mo>
235 <mml:mi mathvariant=
"italic">s
</mml:mi>
240 <mml:mi mathvariant=
"italic">y
</mml:mi>
241 <mml:mo>⁢</mml:mo>
243 <mml:mi mathvariant=
"italic">z
</mml:mi>
244 <mml:mo>⁡</mml:mo>
245 <mml:mfenced open=
"(" close=
")">
249 <mml:mi mathvariant=
"italic">c
</mml:mi>
254 <mml:mi mathvariant=
"italic">x
</mml:mi>
255 <mml:mo>⁢</mml:mo>
256 <mml:mi mathvariant=
"italic">s
</mml:mi>
262 <mml:msup><mml:mi mathvariant=
"italic">z
</mml:mi>
265 <mml:mo>⁡</mml:mo>
266 <mml:mfenced open=
"(" close=
")">
270 <mml:mi mathvariant=
"italic">c
</mml:mi>
275 <mml:mi mathvariant=
"italic">c
</mml:mi>
298 </mml:math></informalequation>
304 <inlineequation><mml:math>
305 <!-- eqn: c = cos (angle):-->
307 <mml:mi mathvariant=
"italic">c
</mml:mi>
310 <mml:mi mathvariant=
"italic">cos
</mml:mi>
311 <mml:mo>⁡</mml:mo>
312 <mml:mfenced open=
"(" close=
")">
313 <mml:mi mathvariant=
"italic">angle
</mml:mi>
317 </mml:math></inlineequation>,
318 <inlineequation><mml:math>
319 <!-- eqn: s = sin (angle):-->
321 <mml:mi mathvariant=
"italic">s
</mml:mi>
324 <mml:mi mathvariant=
"italic">sin
</mml:mi>
325 <mml:mo>⁡</mml:mo>
326 <mml:mfenced open=
"(" close=
")">
327 <mml:mi mathvariant=
"italic">angle
</mml:mi>
331 </mml:math></inlineequation>,
333 <inlineequation><mml:math>
334 <!-- eqn: ||( x, y, z )|| = 1:-->
336 <mml:mfenced open=
"∥" close=
"∥">
337 <mml:mfenced open=
"(" close=
")">
338 <mml:mi mathvariant=
"italic">x
</mml:mi>
339 <mml:mi mathvariant=
"italic">y
</mml:mi>
340 <mml:mi mathvariant=
"italic">z
</mml:mi>
346 </mml:math></inlineequation>
348 will normalize this vector).
355 If the matrix mode is either
<constant>GL_MODELVIEW
</constant> or
<constant>GL_PROJECTION
</constant>,
356 all objects drawn after
<function>glRotate
</function> is called are rotated.
357 Use
<citerefentry><refentrytitle>glPushMatrix
</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glPopMatrix
</refentrytitle></citerefentry> to save and restore
358 the unrotated coordinate system.
361 <refsect1 id=
"notes"><title>Notes
</title>
363 This rotation follows the right-hand rule, so
365 <inlineequation><mml:math>
366 <!-- eqn: (x, y, z):-->
367 <mml:mfenced open=
"(" close=
")">
368 <mml:mi mathvariant=
"italic">x
</mml:mi>
369 <mml:mi mathvariant=
"italic">y
</mml:mi>
370 <mml:mi mathvariant=
"italic">z
</mml:mi>
372 </mml:math></inlineequation>
374 user, the rotation will be counterclockwise.
377 <refsect1 id=
"errors"><title>Errors
</title>
379 <constant>GL_INVALID_OPERATION
</constant> is generated if
<function>glRotate
</function>
380 is executed between the execution of
<citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
381 and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
384 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
386 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MATRIX_MODE
</constant>
389 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_COLOR_MATRIX
</constant>
392 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MODELVIEW_MATRIX
</constant>
395 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_PROJECTION_MATRIX
</constant>
398 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_MATRIX
</constant>
401 <refsect1 id=
"seealso"><title>See Also
</title>
403 <citerefentry><refentrytitle>glMatrixMode
</refentrytitle></citerefentry>,
404 <citerefentry><refentrytitle>glMultMatrix
</refentrytitle></citerefentry>,
405 <citerefentry><refentrytitle>glPushMatrix
</refentrytitle></citerefentry>,
406 <citerefentry><refentrytitle>glScale
</refentrytitle></citerefentry>,
407 <citerefentry><refentrytitle>glTranslate
</refentrytitle></citerefentry>
410 <refsect1 id=
"Copyright"><title>Copyright
</title>
412 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
413 Silicon Graphics, Inc. This document is licensed under the SGI
414 Free Software B License. For details, see
415 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.