forked from BSVino/docs.gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
glMultMatrix.xhtml
190 lines (190 loc) · 9.8 KB
/
glMultMatrix.xhtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<div class="refentry" title="glMultMatrix"><a id="glMultMatrix"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glMultMatrix — multiply the current matrix with the specified
matrix</p></div><div class="refsynopsisdiv" title="C Specification"><h2>C Specification</h2><div class="funcsynopsis"><table class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">glMultMatrixf</b>(</code></td><td>const GLfloat * <var class="pdparam">m</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">glMultMatrixx</b>(</code></td><td>const GLfixed * <var class="pdparam">m</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1" title="Parameters"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term">
<em class="parameter"><code>m</code></em>
</span></dt><dd><p>Points to 16 consecutive values that are used as
the elements of a
<math overflow="scroll">
<mn>4</mn><mo>x</mo><mn>4</mn>
</math>
column-major matrix.</p></dd></dl></div></div><div class="refsect1" title="Description"><a id="description"></a><h2>Description</h2><p><code class="function">glMultMatrix</code>
multiplies the current matrix with the one specified using
<em class="parameter"><code>m</code></em>,
and replaces the current matrix with the product.</p><p>The current matrix is determined by the current matrix mode (see
<a class="citerefentry" href="glMatrixMode"><span class="citerefentry"><span class="refentrytitle">glMatrixMode</span></span></a>).
It is either the projection matrix, modelview matrix, or the
texture matrix.</p></div><div class="refsect1" title="Examples"><a id="examples"></a><h2>Examples</h2><p>If the current matrix is <em class="replaceable"><code>C</code></em>,
and the coordinates to be transformed are,
<math overflow="scroll">
<mi>v</mi><mo>=</mo>
<mfenced>
<mrow><mi>v</mi><mo>[</mo><mn>0</mn><mo>]</mo></mrow>
<mrow><mi>v</mi><mo>[</mo><mn>1</mn><mo>]</mo></mrow>
<mrow><mi>v</mi><mo>[</mo><mn>2</mn><mo>]</mo></mrow>
<mrow><mi>v</mi><mo>[</mo><mn>3</mn><mo>]</mo></mrow>
</mfenced>
</math>,
then the current transformation is
<math overflow="scroll">
<mi>C</mi><mo>x</mo><mi>v</mi>
</math>, or
</p><div class="informalequation"><math overflow="scroll"><mrow>
<mo>(</mo>
<mtable class="matrix">
<mtr>
<mtd><mi>c</mi><mo>[</mo><mn>0</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>4</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>8</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>12</mn><mo>]</mo></mtd>
</mtr>
<mtr>
<mtd><mi>c</mi><mo>[</mo><mn>1</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>5</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>9</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>13</mn><mo>]</mo></mtd>
</mtr>
<mtr>
<mtd><mi>c</mi><mo>[</mo><mn>2</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>6</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>10</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>14</mn><mo>]</mo></mtd>
</mtr>
<mtr>
<mtd><mi>c</mi><mo>[</mo><mn>3</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>7</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>11</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>15</mn><mo>]</mo></mtd>
</mtr>
</mtable>
<mo>)</mo>
<mo>x</mo>
<mo>(</mo>
<mtable class="vector">
<mtr><mtd><mi>v</mi><mo>[</mo><mn>0</mn><mo>]</mo></mtd></mtr>
<mtr><mtd><mi>v</mi><mo>[</mo><mn>1</mn><mo>]</mo></mtd></mtr>
<mtr><mtd><mi>v</mi><mo>[</mo><mn>2</mn><mo>]</mo></mtd></mtr>
<mtr><mtd><mi>v</mi><mo>[</mo><mn>3</mn><mo>]</mo></mtd></mtr>
</mtable>
<mo>)</mo>
</mrow></math></div><p>Calling
<code class="function">glMultMatrix</code>
with an argument of
<math overflow="scroll">
<mrow>
<mi>m</mi><mo>=</mo>
<mi>m</mi><mo>[</mo><mn>0</mn><mo>]</mo>,
<mi>m</mi><mo>[</mo><mn>1</mn><mo>]</mo>,
<mo>...</mo>
<mi>m</mi><mo>[</mo><mn>15</mn><mo>]</mo>
</mrow>
</math>
replaces the current transformation with
<math overflow="scroll">
<mfenced><mrow><mi>C</mi><mo>x</mo><mi>M</mi></mrow></mfenced>
<mo>x</mo><mi>v</mi>
</math>, or</p><div class="informalequation"><math overflow="scroll"><mrow>
<mo>(</mo>
<mtable class="matrix">
<mtr>
<mtd><mi>c</mi><mo>[</mo><mn>0</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>4</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>8</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>12</mn><mo>]</mo></mtd>
</mtr>
<mtr>
<mtd><mi>c</mi><mo>[</mo><mn>1</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>5</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>9</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>13</mn><mo>]</mo></mtd>
</mtr>
<mtr>
<mtd><mi>c</mi><mo>[</mo><mn>2</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>6</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>10</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>14</mn><mo>]</mo></mtd>
</mtr>
<mtr>
<mtd><mi>c</mi><mo>[</mo><mn>3</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>7</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>11</mn><mo>]</mo></mtd>
<mtd><mi>c</mi><mo>[</mo><mn>15</mn><mo>]</mo></mtd>
</mtr>
</mtable>
<mo>)</mo>
<mo>x</mo>
<mo>(</mo>
<mtable class="matrix">
<mtr>
<mtd><mi>m</mi><mo>[</mo><mn>0</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>4</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>8</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>12</mn><mo>]</mo></mtd>
</mtr>
<mtr>
<mtd><mi>m</mi><mo>[</mo><mn>1</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>5</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>9</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>13</mn><mo>]</mo></mtd>
</mtr>
<mtr>
<mtd><mi>m</mi><mo>[</mo><mn>2</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>6</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>10</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>14</mn><mo>]</mo></mtd>
</mtr>
<mtr>
<mtd><mi>m</mi><mo>[</mo><mn>3</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>7</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>11</mn><mo>]</mo></mtd>
<mtd><mi>m</mi><mo>[</mo><mn>15</mn><mo>]</mo></mtd>
</mtr>
</mtable>
<mo>)</mo>
<mo>x</mo>
<mo>(</mo>
<mtable class="vector">
<mtr><mtd><mi>v</mi><mo>[</mo><mn>0</mn><mo>]</mo></mtd></mtr>
<mtr><mtd><mi>v</mi><mo>[</mo><mn>1</mn><mo>]</mo></mtd></mtr>
<mtr><mtd><mi>v</mi><mo>[</mo><mn>2</mn><mo>]</mo></mtd></mtr>
<mtr><mtd><mi>v</mi><mo>[</mo><mn>3</mn><mo>]</mo></mtd></mtr>
</mtable>
<mo>)</mo>
</mrow></math></div><p>Where
``<math overflow="scroll"><mo>x</mo></math>''
denotes matrix multiplication, and
<em class="replaceable"><code>v</code></em>
is represented as a
<math overflow="scroll">
<mn>4</mn><mo>x</mo><mn>1</mn>
</math>
matrix.</p></div><div class="refsect1" title="Notes"><a id="notes"></a><h2>Notes</h2><p>While the elements of the matrix may be specified with
fixed point or single precision, the GL may store or operate on
these values in less than single precision.</p><p>In many computer languages
<math overflow="scroll">
<mn>4</mn><mo>x</mo><mn>4</mn>
</math>
arrays are represented in row-major order. The transformations
just described represent these matrices in column-major order.
The order of the multiplication is important. For example, if
the current transformation is a rotation, and
<code class="function">glMultMatrix</code>
is called with a translation matrix, the translation is done
directly on the coordinates to be transformed, while the
rotation is done on the results of that translation.</p></div><div class="refsect1" title="Associated Gets"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_MATRIX_MODE</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_MODELVIEW_MATRIX</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PROJECTION_MATRIX</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_TEXTURE_MATRIX</code>
</p></div><div class="refsect1" title="See Also"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glLoadIdentity"><span class="citerefentry"><span class="refentrytitle">glLoadIdentity</span></span></a>,
<a class="citerefentry" href="glLoadMatrix"><span class="citerefentry"><span class="refentrytitle">glLoadMatrix</span></span></a>,
<a class="citerefentry" href="glMatrixMode"><span class="citerefentry"><span class="refentrytitle">glMatrixMode</span></span></a>,
<a class="citerefentry" href="glPushMatrix"><span class="citerefentry"><span class="refentrytitle">glPushMatrix</span></span></a>
</p></div><div class="refsect1" title="Copyright"><a id="copyright"></a><h2>Copyright</h2><p>
Copyright © 2003-2004
Silicon Graphics, Inc. This document is licensed under the SGI
Free Software B License. For details, see
<a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
</p></div></div>