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=
"glMultMatrix">
9 <holder>Silicon Graphics, Inc.
</holder>
12 <refentrytitle>glMultMatrix
</refentrytitle>
13 <manvolnum>3G
</manvolnum>
16 <refname>glMultMatrix
</refname>
17 <refpurpose>multiply the current matrix with the specified matrix
</refpurpose>
19 <refsynopsisdiv><title>C Specification
</title>
22 <funcdef>void
<function>glMultMatrixd
</function></funcdef>
23 <paramdef>const GLdouble *
<parameter>m
</parameter></paramdef>
28 <funcdef>void
<function>glMultMatrixf
</function></funcdef>
29 <paramdef>const GLfloat *
<parameter>m
</parameter></paramdef>
33 <!-- eqn: ignoring delim $$ -->
34 <refsect1 id=
"parameters"><title>Parameters
</title>
37 <term><parameter>m
</parameter></term>
40 Points to
16 consecutive values that are used as the elements of
42 <inlineequation><mml:math>
43 <!-- eqn: 4 times 4:-->
46 <mml:mo>×</mml:mo>
49 </mml:math></inlineequation>
56 <refsect1 id=
"description"><title>Description
</title>
58 <function>glMultMatrix
</function> multiplies the current matrix with the one specified using
<parameter>m
</parameter>, and
59 replaces the current matrix with the product.
62 The current matrix is determined by the current matrix mode (see
<citerefentry><refentrytitle>glMatrixMode
</refentrytitle></citerefentry>). It is either the projection matrix,
64 or the texture matrix.
67 <refsect1 id=
"examples"><title>Examples
</title>
69 If the current matrix is
70 <inlineequation><mml:math><mml:mi mathvariant=
"italic">C
</mml:mi></mml:math></inlineequation>
73 <inlineequation><mml:math>
74 <!-- eqn: v = (v[0], v[1], v[2], v[3]):-->
76 <mml:mi mathvariant=
"italic">v
</mml:mi>
78 <mml:mfenced open=
"(" close=
")">
80 <mml:mi mathvariant=
"italic">v
</mml:mi>
82 <mml:mfenced open=
"[" close=
"]">
87 <mml:mi mathvariant=
"italic">v
</mml:mi>
89 <mml:mfenced open=
"[" close=
"]">
94 <mml:mi mathvariant=
"italic">v
</mml:mi>
96 <mml:mfenced open=
"[" close=
"]">
101 <mml:mi mathvariant=
"italic">v
</mml:mi>
102 <mml:mo>⁡</mml:mo>
103 <mml:mfenced open=
"[" close=
"]">
109 </mml:math></inlineequation>,
110 then the current transformation is
111 <inlineequation><mml:math>
112 <!-- eqn: C times v:-->
114 <mml:mi mathvariant=
"italic">C
</mml:mi>
115 <mml:mo>×</mml:mo>
116 <mml:mi mathvariant=
"italic">v
</mml:mi>
118 </mml:math></inlineequation>,
122 <informalequation><mml:math>
123 <!-- eqn: left ( matrix { ccol { c[0] above c[1] above c[2] above c[3] } ccol { c[4] above c[5] above c[6] above c[7] } ccol { c[8] above c[9] above c[10] above c[11] } ccol { c[12] above c[13] above c[14] above c[15] } } right ) times left ( matrix { ccol { v[0] above v[1] above v[2] above v[3] } } right ):-->
125 <mml:mfenced open=
"(" close=
")">
130 <mml:mi mathvariant=
"italic">c
</mml:mi>
131 <mml:mo>⁡</mml:mo>
132 <mml:mfenced open=
"[" close=
"]">
139 <mml:mi mathvariant=
"italic">c
</mml:mi>
140 <mml:mo>⁡</mml:mo>
141 <mml:mfenced open=
"[" close=
"]">
148 <mml:mi mathvariant=
"italic">c
</mml:mi>
149 <mml:mo>⁡</mml:mo>
150 <mml:mfenced open=
"[" close=
"]">
157 <mml:mi mathvariant=
"italic">c
</mml:mi>
158 <mml:mo>⁡</mml:mo>
159 <mml:mfenced open=
"[" close=
"]">
168 <mml:mi mathvariant=
"italic">c
</mml:mi>
169 <mml:mo>⁡</mml:mo>
170 <mml:mfenced open=
"[" close=
"]">
177 <mml:mi mathvariant=
"italic">c
</mml:mi>
178 <mml:mo>⁡</mml:mo>
179 <mml:mfenced open=
"[" close=
"]">
186 <mml:mi mathvariant=
"italic">c
</mml:mi>
187 <mml:mo>⁡</mml:mo>
188 <mml:mfenced open=
"[" close=
"]">
195 <mml:mi mathvariant=
"italic">c
</mml:mi>
196 <mml:mo>⁡</mml:mo>
197 <mml:mfenced open=
"[" close=
"]">
206 <mml:mi mathvariant=
"italic">c
</mml:mi>
207 <mml:mo>⁡</mml:mo>
208 <mml:mfenced open=
"[" close=
"]">
215 <mml:mi mathvariant=
"italic">c
</mml:mi>
216 <mml:mo>⁡</mml:mo>
217 <mml:mfenced open=
"[" close=
"]">
224 <mml:mi mathvariant=
"italic">c
</mml:mi>
225 <mml:mo>⁡</mml:mo>
226 <mml:mfenced open=
"[" close=
"]">
233 <mml:mi mathvariant=
"italic">c
</mml:mi>
234 <mml:mo>⁡</mml:mo>
235 <mml:mfenced open=
"[" close=
"]">
244 <mml:mi mathvariant=
"italic">c
</mml:mi>
245 <mml:mo>⁡</mml:mo>
246 <mml:mfenced open=
"[" close=
"]">
253 <mml:mi mathvariant=
"italic">c
</mml:mi>
254 <mml:mo>⁡</mml:mo>
255 <mml:mfenced open=
"[" close=
"]">
262 <mml:mi mathvariant=
"italic">c
</mml:mi>
263 <mml:mo>⁡</mml:mo>
264 <mml:mfenced open=
"[" close=
"]">
271 <mml:mi mathvariant=
"italic">c
</mml:mi>
272 <mml:mo>⁡</mml:mo>
273 <mml:mfenced open=
"[" close=
"]">
281 <mml:mo>×</mml:mo>
282 <mml:mfenced open=
"(" close=
")">
287 <mml:mi mathvariant=
"italic">v
</mml:mi>
288 <mml:mo>⁡</mml:mo>
289 <mml:mfenced open=
"[" close=
"]">
298 <mml:mi mathvariant=
"italic">v
</mml:mi>
299 <mml:mo>⁡</mml:mo>
300 <mml:mfenced open=
"[" close=
"]">
309 <mml:mi mathvariant=
"italic">v
</mml:mi>
310 <mml:mo>⁡</mml:mo>
311 <mml:mfenced open=
"[" close=
"]">
320 <mml:mi mathvariant=
"italic">v
</mml:mi>
321 <mml:mo>⁡</mml:mo>
322 <mml:mfenced open=
"[" close=
"]">
331 </mml:math></informalequation>
336 Calling
<function>glMultMatrix
</function> with an argument of
337 <inlineequation><mml:math>
338 <!-- eqn: m = left { m[0], m[1], ..., m[15] right }:-->
340 <mml:mi mathvariant=
"italic">m
</mml:mi>
342 <mml:mfenced open=
"{" close=
"}">
344 <mml:mi mathvariant=
"italic">m
</mml:mi>
345 <mml:mo>⁡</mml:mo>
346 <mml:mfenced open=
"[" close=
"]">
351 <mml:mi mathvariant=
"italic">m
</mml:mi>
352 <mml:mo>⁡</mml:mo>
353 <mml:mfenced open=
"[" close=
"]">
357 <mml:mi mathvariant=
"italic">...
</mml:mi>
359 <mml:mi mathvariant=
"italic">m
</mml:mi>
360 <mml:mo>⁡</mml:mo>
361 <mml:mfenced open=
"[" close=
"]">
367 </mml:math></inlineequation>
368 replaces the current transformation with
369 <inlineequation><mml:math>
370 <!-- eqn: (C times M) times v:-->
372 <mml:mfenced open=
"(" close=
")">
374 <mml:mi mathvariant=
"italic">C
</mml:mi>
375 <mml:mo>×</mml:mo>
376 <mml:mi mathvariant=
"italic">M
</mml:mi>
379 <mml:mo>×</mml:mo>
380 <mml:mi mathvariant=
"italic">v
</mml:mi>
382 </mml:math></inlineequation>,
386 <informalequation><mml:math>
387 <!-- eqn: left ( matrix { ccol { c[0] above c[1] above c[2] above c[3] } ccol { c[4] above c[5] above c[6] above c[7] } ccol { c[8] above c[9] above c[10] above c[11] } ccol { c[12] above c[13] above c[14] above c[15] } } right ) times left ( matrix { ccol { m[0] above m[1] above m[2] above m[3] } ccol { m[4] above m[5] above m[6] above m[7] } ccol { m[8] above m[9] above m[10] above m[11] } ccol { m[12] above m[13] above m[14] above m[15] } } right ) times left ( matrix { ccol { v[0] above v[1] above v[2] above v[3] } } right ):-->
389 <mml:mfenced open=
"(" close=
")">
394 <mml:mi mathvariant=
"italic">c
</mml:mi>
395 <mml:mo>⁡</mml:mo>
396 <mml:mfenced open=
"[" close=
"]">
403 <mml:mi mathvariant=
"italic">c
</mml:mi>
404 <mml:mo>⁡</mml:mo>
405 <mml:mfenced open=
"[" close=
"]">
412 <mml:mi mathvariant=
"italic">c
</mml:mi>
413 <mml:mo>⁡</mml:mo>
414 <mml:mfenced open=
"[" close=
"]">
421 <mml:mi mathvariant=
"italic">c
</mml:mi>
422 <mml:mo>⁡</mml:mo>
423 <mml:mfenced open=
"[" close=
"]">
432 <mml:mi mathvariant=
"italic">c
</mml:mi>
433 <mml:mo>⁡</mml:mo>
434 <mml:mfenced open=
"[" close=
"]">
441 <mml:mi mathvariant=
"italic">c
</mml:mi>
442 <mml:mo>⁡</mml:mo>
443 <mml:mfenced open=
"[" close=
"]">
450 <mml:mi mathvariant=
"italic">c
</mml:mi>
451 <mml:mo>⁡</mml:mo>
452 <mml:mfenced open=
"[" close=
"]">
459 <mml:mi mathvariant=
"italic">c
</mml:mi>
460 <mml:mo>⁡</mml:mo>
461 <mml:mfenced open=
"[" close=
"]">
470 <mml:mi mathvariant=
"italic">c
</mml:mi>
471 <mml:mo>⁡</mml:mo>
472 <mml:mfenced open=
"[" close=
"]">
479 <mml:mi mathvariant=
"italic">c
</mml:mi>
480 <mml:mo>⁡</mml:mo>
481 <mml:mfenced open=
"[" close=
"]">
488 <mml:mi mathvariant=
"italic">c
</mml:mi>
489 <mml:mo>⁡</mml:mo>
490 <mml:mfenced open=
"[" close=
"]">
497 <mml:mi mathvariant=
"italic">c
</mml:mi>
498 <mml:mo>⁡</mml:mo>
499 <mml:mfenced open=
"[" close=
"]">
508 <mml:mi mathvariant=
"italic">c
</mml:mi>
509 <mml:mo>⁡</mml:mo>
510 <mml:mfenced open=
"[" close=
"]">
517 <mml:mi mathvariant=
"italic">c
</mml:mi>
518 <mml:mo>⁡</mml:mo>
519 <mml:mfenced open=
"[" close=
"]">
526 <mml:mi mathvariant=
"italic">c
</mml:mi>
527 <mml:mo>⁡</mml:mo>
528 <mml:mfenced open=
"[" close=
"]">
535 <mml:mi mathvariant=
"italic">c
</mml:mi>
536 <mml:mo>⁡</mml:mo>
537 <mml:mfenced open=
"[" close=
"]">
545 <mml:mo>×</mml:mo>
546 <mml:mfenced open=
"(" close=
")">
551 <mml:mi mathvariant=
"italic">m
</mml:mi>
552 <mml:mo>⁡</mml:mo>
553 <mml:mfenced open=
"[" close=
"]">
560 <mml:mi mathvariant=
"italic">m
</mml:mi>
561 <mml:mo>⁡</mml:mo>
562 <mml:mfenced open=
"[" close=
"]">
569 <mml:mi mathvariant=
"italic">m
</mml:mi>
570 <mml:mo>⁡</mml:mo>
571 <mml:mfenced open=
"[" close=
"]">
578 <mml:mi mathvariant=
"italic">m
</mml:mi>
579 <mml:mo>⁡</mml:mo>
580 <mml:mfenced open=
"[" close=
"]">
589 <mml:mi mathvariant=
"italic">m
</mml:mi>
590 <mml:mo>⁡</mml:mo>
591 <mml:mfenced open=
"[" close=
"]">
598 <mml:mi mathvariant=
"italic">m
</mml:mi>
599 <mml:mo>⁡</mml:mo>
600 <mml:mfenced open=
"[" close=
"]">
607 <mml:mi mathvariant=
"italic">m
</mml:mi>
608 <mml:mo>⁡</mml:mo>
609 <mml:mfenced open=
"[" close=
"]">
616 <mml:mi mathvariant=
"italic">m
</mml:mi>
617 <mml:mo>⁡</mml:mo>
618 <mml:mfenced open=
"[" close=
"]">
627 <mml:mi mathvariant=
"italic">m
</mml:mi>
628 <mml:mo>⁡</mml:mo>
629 <mml:mfenced open=
"[" close=
"]">
636 <mml:mi mathvariant=
"italic">m
</mml:mi>
637 <mml:mo>⁡</mml:mo>
638 <mml:mfenced open=
"[" close=
"]">
645 <mml:mi mathvariant=
"italic">m
</mml:mi>
646 <mml:mo>⁡</mml:mo>
647 <mml:mfenced open=
"[" close=
"]">
654 <mml:mi mathvariant=
"italic">m
</mml:mi>
655 <mml:mo>⁡</mml:mo>
656 <mml:mfenced open=
"[" close=
"]">
665 <mml:mi mathvariant=
"italic">m
</mml:mi>
666 <mml:mo>⁡</mml:mo>
667 <mml:mfenced open=
"[" close=
"]">
674 <mml:mi mathvariant=
"italic">m
</mml:mi>
675 <mml:mo>⁡</mml:mo>
676 <mml:mfenced open=
"[" close=
"]">
683 <mml:mi mathvariant=
"italic">m
</mml:mi>
684 <mml:mo>⁡</mml:mo>
685 <mml:mfenced open=
"[" close=
"]">
692 <mml:mi mathvariant=
"italic">m
</mml:mi>
693 <mml:mo>⁡</mml:mo>
694 <mml:mfenced open=
"[" close=
"]">
702 <mml:mo>×</mml:mo>
703 <mml:mfenced open=
"(" close=
")">
708 <mml:mi mathvariant=
"italic">v
</mml:mi>
709 <mml:mo>⁡</mml:mo>
710 <mml:mfenced open=
"[" close=
"]">
719 <mml:mi mathvariant=
"italic">v
</mml:mi>
720 <mml:mo>⁡</mml:mo>
721 <mml:mfenced open=
"[" close=
"]">
730 <mml:mi mathvariant=
"italic">v
</mml:mi>
731 <mml:mo>⁡</mml:mo>
732 <mml:mfenced open=
"[" close=
"]">
741 <mml:mi mathvariant=
"italic">v
</mml:mi>
742 <mml:mo>⁡</mml:mo>
743 <mml:mfenced open=
"[" close=
"]">
752 </mml:math></informalequation>
758 <inlineequation><mml:math><mml:mi mathvariant=
"italic">v
</mml:mi></mml:math></inlineequation>
760 <inlineequation><mml:math>
761 <!-- eqn: 4 times 1:-->
764 <mml:mo>×</mml:mo>
767 </mml:math></inlineequation>
771 <refsect1 id=
"notes"><title>Notes
</title>
773 While the elements of the matrix may be specified with
774 single or double precision, the GL may store or operate on these
775 values in less-than-single precision.
778 In many computer languages,
779 <inlineequation><mml:math>
780 <!-- eqn: 4 times 4:-->
783 <mml:mo>×</mml:mo>
786 </mml:math></inlineequation>
787 arrays are represented
788 in row-major order. The transformations just described
789 represent these matrices in column-major order.
790 The order of the multiplication is important. For example, if the current
791 transformation is a rotation, and
<function>glMultMatrix
</function> is called with a translation matrix,
792 the translation is done directly on the coordinates to be transformed,
793 while the rotation is done on the results of that translation.
796 <refsect1 id=
"errors"><title>Errors
</title>
798 <constant>GL_INVALID_OPERATION
</constant> is generated if
<function>glMultMatrix
</function>
799 is executed between the execution of
<citerefentry><refentrytitle>glBegin
</refentrytitle></citerefentry>
800 and the corresponding execution of
<citerefentry><refentrytitle>glEnd
</refentrytitle></citerefentry>.
803 <refsect1 id=
"associatedgets"><title>Associated Gets
</title>
805 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MATRIX_MODE
</constant>
808 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_COLOR_MATRIX
</constant>
811 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_MODELVIEW_MATRIX
</constant>
814 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_PROJECTION_MATRIX
</constant>
817 <citerefentry><refentrytitle>glGet
</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_MATRIX
</constant>
820 <refsect1 id=
"seealso"><title>See Also
</title>
822 <citerefentry><refentrytitle>glLoadIdentity
</refentrytitle></citerefentry>,
823 <citerefentry><refentrytitle>glLoadMatrix
</refentrytitle></citerefentry>,
824 <citerefentry><refentrytitle>glLoadTransposeMatrix
</refentrytitle></citerefentry>,
825 <citerefentry><refentrytitle>glMatrixMode
</refentrytitle></citerefentry>,
826 <citerefentry><refentrytitle>glMultTransposeMatrix
</refentrytitle></citerefentry>,
827 <citerefentry><refentrytitle>glPushMatrix
</refentrytitle></citerefentry>
830 <refsect1 id=
"Copyright"><title>Copyright
</title>
832 Copyright
<trademark class=
"copyright"></trademark> 1991-
2006
833 Silicon Graphics, Inc. This document is licensed under the SGI
834 Free Software B License. For details, see
835 <ulink url=
"http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/
</ulink>.