~oem-solutions-group/unity-2d/clutter-1.0

« back to all changes in this revision

Viewing changes to doc/reference/cogl/html/cogl-Matrices.html

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2010-03-21 13:27:56 UTC
  • mto: (2.1.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20100321132756-nf8yd30yxo3zzwcm
Tags: upstream-1.2.2
Import upstream version 1.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
<link rel="up" href="ch01.html" title="COGL - GL Abstraction API">
9
9
<link rel="prev" href="cogl-Vertex-Buffers.html" title="Vertex Buffers">
10
10
<link rel="next" href="cogl-Shaders-and-Programmable-Pipeline.html" title="Shaders and Programmable Pipeline">
11
 
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
 
11
<meta name="generator" content="GTK-Doc V1.13 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
13
<link rel="chapter" href="ch01.html" title="COGL - GL Abstraction API">
14
 
<link rel="index" href="ix01.html" title="Index">
 
14
<link rel="chapter" href="ch02.html" title="COGL experimental API">
 
15
<link rel="index" href="ix01.html" title="Index of all symbols">
 
16
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
 
17
<link rel="index" href="ix03.html" title="Index of new symbols in 0.8">
 
18
<link rel="index" href="ix04.html" title="Index of new symbols in 1.0">
 
19
<link rel="index" href="ix05.html" title="Index of new symbols in 1.2">
15
20
<link rel="appendix" href="license.html" title="Appendix A. License">
16
21
</head>
17
22
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
25
30
</tr>
26
31
<tr><td colspan="5" class="shortcuts">
27
32
<a href="#cogl-Matrices.synopsis" class="shortcut">Top</a>
28
 
                 | 
29
 
                <a href="#cogl-Matrices.description" class="shortcut">Description</a>
 
33
                   | 
 
34
                  <a href="#cogl-Matrices.description" class="shortcut">Description</a>
30
35
</td></tr>
31
36
</table>
32
37
<div class="refentry" title="Matrices">
34
39
<div class="refnamediv"><table width="100%"><tr>
35
40
<td valign="top">
36
41
<h2><span class="refentrytitle"><a name="cogl-Matrices.top_of_page"></a>Matrices</span></h2>
37
 
<p>Matrices — Fuctions for initializing and manipulating 4x4
38
 
                    matrices.</p>
 
42
<p>Matrices — Fuctions for initializing and manipulating 4x4 matrices</p>
39
43
</td>
40
44
<td valign="top" align="right"></td>
41
45
</tr></table></div>
42
46
<div class="refsynopsisdiv" title="Synopsis">
43
47
<a name="cogl-Matrices.synopsis"></a><h2>Synopsis</h2>
44
 
<pre class="synopsis">
45
 
                    <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a>;
46
 
void                <a class="link" href="cogl-Matrices.html#cogl-matrix-init-identity" title="cogl_matrix_init_identity ()">cogl_matrix_init_identity</a>           (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix);
47
 
void                <a class="link" href="cogl-Matrices.html#cogl-matrix-frustum" title="cogl_matrix_frustum ()">cogl_matrix_frustum</a>                 (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
48
 
                                                         float left,
49
 
                                                         float right,
50
 
                                                         float bottom,
51
 
                                                         float top,
52
 
                                                         float z_near,
53
 
                                                         float z_far);
54
 
void                <a class="link" href="cogl-Matrices.html#cogl-matrix-ortho" title="cogl_matrix_ortho ()">cogl_matrix_ortho</a>                   (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
55
 
                                                         float left,
56
 
                                                         float right,
57
 
                                                         float bottom,
58
 
                                                         float top,
59
 
                                                         float z_near,
60
 
                                                         float z_far);
61
 
void                <a class="link" href="cogl-Matrices.html#cogl-matrix-perspective" title="cogl_matrix_perspective ()">cogl_matrix_perspective</a>             (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
62
 
                                                         float fov_y,
63
 
                                                         float aspect,
64
 
                                                         float z_near,
65
 
                                                         float z_far);
66
 
void                <a class="link" href="cogl-Matrices.html#cogl-matrix-transform-point" title="cogl_matrix_transform_point ()">cogl_matrix_transform_point</a>         (const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
67
 
                                                         float *x,
68
 
                                                         float *y,
69
 
                                                         float *z,
70
 
                                                         float *w);
71
 
void                <a class="link" href="cogl-Matrices.html#cogl-matrix-multiply" title="cogl_matrix_multiply ()">cogl_matrix_multiply</a>                (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *result,
72
 
                                                         const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *a,
73
 
                                                         const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *b);
74
 
void                <a class="link" href="cogl-Matrices.html#cogl-matrix-rotate" title="cogl_matrix_rotate ()">cogl_matrix_rotate</a>                  (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
75
 
                                                         float angle,
76
 
                                                         float x,
77
 
                                                         float y,
78
 
                                                         float z);
79
 
void                <a class="link" href="cogl-Matrices.html#cogl-matrix-translate" title="cogl_matrix_translate ()">cogl_matrix_translate</a>               (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
80
 
                                                         float x,
81
 
                                                         float y,
82
 
                                                         float z);
83
 
void                <a class="link" href="cogl-Matrices.html#cogl-matrix-scale" title="cogl_matrix_scale ()">cogl_matrix_scale</a>                   (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
84
 
                                                         float sx,
85
 
                                                         float sy,
86
 
                                                         float sz);
87
 
void                <a class="link" href="cogl-Matrices.html#cogl-matrix-init-from-array" title="cogl_matrix_init_from_array ()">cogl_matrix_init_from_array</a>         (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
88
 
                                                         const float *array);
89
 
const float *       <a class="link" href="cogl-Matrices.html#cogl-matrix-get-array" title="cogl_matrix_get_array ()">cogl_matrix_get_array</a>               (const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix);
 
48
<pre class="synopsis">                    <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a>;
 
49
<span class="returnvalue">void</span>                <a class="link" href="cogl-Matrices.html#cogl-matrix-init-identity" title="cogl_matrix_init_identity ()">cogl_matrix_init_identity</a>           (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);
 
50
<span class="returnvalue">void</span>                <a class="link" href="cogl-Matrices.html#cogl-matrix-frustum" title="cogl_matrix_frustum ()">cogl_matrix_frustum</a>                 (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
51
                                                         <span class="returnvalue">float</span> left,
 
52
                                                         <span class="returnvalue">float</span> right,
 
53
                                                         <span class="returnvalue">float</span> bottom,
 
54
                                                         <span class="returnvalue">float</span> top,
 
55
                                                         <span class="returnvalue">float</span> z_near,
 
56
                                                         <span class="returnvalue">float</span> z_far);
 
57
<span class="returnvalue">void</span>                <a class="link" href="cogl-Matrices.html#cogl-matrix-ortho" title="cogl_matrix_ortho ()">cogl_matrix_ortho</a>                   (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
58
                                                         <span class="returnvalue">float</span> left,
 
59
                                                         <span class="returnvalue">float</span> right,
 
60
                                                         <span class="returnvalue">float</span> bottom,
 
61
                                                         <span class="returnvalue">float</span> top,
 
62
                                                         <span class="returnvalue">float</span> z_near,
 
63
                                                         <span class="returnvalue">float</span> z_far);
 
64
<span class="returnvalue">void</span>                <a class="link" href="cogl-Matrices.html#cogl-matrix-perspective" title="cogl_matrix_perspective ()">cogl_matrix_perspective</a>             (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
65
                                                         <span class="returnvalue">float</span> fov_y,
 
66
                                                         <span class="returnvalue">float</span> aspect,
 
67
                                                         <span class="returnvalue">float</span> z_near,
 
68
                                                         <span class="returnvalue">float</span> z_far);
 
69
<span class="returnvalue">void</span>                <a class="link" href="cogl-Matrices.html#cogl-matrix-transform-point" title="cogl_matrix_transform_point ()">cogl_matrix_transform_point</a>         (const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
70
                                                         <span class="returnvalue">float</span> *x,
 
71
                                                         <span class="returnvalue">float</span> *y,
 
72
                                                         <span class="returnvalue">float</span> *z,
 
73
                                                         <span class="returnvalue">float</span> *w);
 
74
<span class="returnvalue">void</span>                <a class="link" href="cogl-Matrices.html#cogl-matrix-multiply" title="cogl_matrix_multiply ()">cogl_matrix_multiply</a>                (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *result,
 
75
                                                         const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *a,
 
76
                                                         const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *b);
 
77
<span class="returnvalue">void</span>                <a class="link" href="cogl-Matrices.html#cogl-matrix-rotate" title="cogl_matrix_rotate ()">cogl_matrix_rotate</a>                  (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
78
                                                         <span class="returnvalue">float</span> angle,
 
79
                                                         <span class="returnvalue">float</span> x,
 
80
                                                         <span class="returnvalue">float</span> y,
 
81
                                                         <span class="returnvalue">float</span> z);
 
82
<span class="returnvalue">void</span>                <a class="link" href="cogl-Matrices.html#cogl-matrix-translate" title="cogl_matrix_translate ()">cogl_matrix_translate</a>               (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
83
                                                         <span class="returnvalue">float</span> x,
 
84
                                                         <span class="returnvalue">float</span> y,
 
85
                                                         <span class="returnvalue">float</span> z);
 
86
<span class="returnvalue">void</span>                <a class="link" href="cogl-Matrices.html#cogl-matrix-scale" title="cogl_matrix_scale ()">cogl_matrix_scale</a>                   (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
87
                                                         <span class="returnvalue">float</span> sx,
 
88
                                                         <span class="returnvalue">float</span> sy,
 
89
                                                         <span class="returnvalue">float</span> sz);
 
90
<span class="returnvalue">void</span>                <a class="link" href="cogl-Matrices.html#cogl-matrix-init-from-array" title="cogl_matrix_init_from_array ()">cogl_matrix_init_from_array</a>         (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
91
                                                         const <span class="returnvalue">float</span> *array);
 
92
const <span class="returnvalue">float</span> *       <a class="link" href="cogl-Matrices.html#cogl-matrix-get-array" title="cogl_matrix_get_array ()">cogl_matrix_get_array</a>               (const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);
 
93
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="cogl-Matrices.html#cogl-matrix-get-inverse" title="cogl_matrix_get_inverse ()">cogl_matrix_get_inverse</a>             (const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
94
                                                         <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *inverse);
90
95
</pre>
91
96
</div>
92
97
<div class="refsect1" title="Description">
95
100
Matrices are used in Cogl to describe affine model-view transforms, texture
96
101
transforms, and projective transforms. This exposes a utility API that can
97
102
be used for direct manipulation of these matrices.</p>
98
 
<p>
99
 
</p>
100
103
</div>
101
104
<div class="refsect1" title="Details">
102
105
<a name="cogl-Matrices.details"></a><h2>Details</h2>
139
142
allows Cogl to annotate the matrices internally. Violation of this will give
140
143
undefined results. If you need to initialize a matrix with a constant other
141
144
than the identity matrix you can use <a class="link" href="cogl-Matrices.html#cogl-matrix-init-from-array" title="cogl_matrix_init_from_array ()"><code class="function">cogl_matrix_init_from_array()</code></a>.</div>
142
 
<p>
143
 
</p>
144
145
</div>
145
146
<hr>
146
147
<div class="refsect2" title="cogl_matrix_init_identity ()">
147
148
<a name="cogl-matrix-init-identity"></a><h3>cogl_matrix_init_identity ()</h3>
148
 
<pre class="programlisting">void                cogl_matrix_init_identity           (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix);</pre>
 
149
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_matrix_init_identity           (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);</pre>
149
150
<p>
150
151
Resets matrix to the identity matrix:
151
152
</p>
152
 
<pre class="programlisting">
153
 
.xx=1; .xy=0; .xz=0; .xw=0;
154
 
.yx=0; .yy=1; .yz=0; .yw=0;
155
 
.zx=0; .zy=0; .zz=1; .zw=0;
156
 
.wx=0; .wy=0; .wz=0; .ww=1;
157
 
</pre>
158
153
<p>
159
154
</p>
 
155
<div class="informalexample"><pre class="programlisting">
 
156
  .xx=1; .xy=0; .xz=0; .xw=0;
 
157
  .yx=0; .yy=1; .yz=0; .yw=0;
 
158
  .zx=0; .zy=0; .zz=1; .zw=0;
 
159
  .wx=0; .wy=0; .wz=0; .ww=1;
 
160
</pre></div>
160
161
<div class="variablelist"><table border="0">
161
162
<col align="left" valign="top">
162
163
<tbody><tr>
169
170
<hr>
170
171
<div class="refsect2" title="cogl_matrix_frustum ()">
171
172
<a name="cogl-matrix-frustum"></a><h3>cogl_matrix_frustum ()</h3>
172
 
<pre class="programlisting">void                cogl_matrix_frustum                 (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
173
 
                                                         float left,
174
 
                                                         float right,
175
 
                                                         float bottom,
176
 
                                                         float top,
177
 
                                                         float z_near,
178
 
                                                         float z_far);</pre>
179
 
<p>
180
 
Multiplies the matrix by the given frustum perspective matrix.</p>
181
 
<p>
182
 
</p>
 
173
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_matrix_frustum                 (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
174
                                                         <span class="returnvalue">float</span> left,
 
175
                                                         <span class="returnvalue">float</span> right,
 
176
                                                         <span class="returnvalue">float</span> bottom,
 
177
                                                         <span class="returnvalue">float</span> top,
 
178
                                                         <span class="returnvalue">float</span> z_near,
 
179
                                                         <span class="returnvalue">float</span> z_far);</pre>
 
180
<p>
 
181
Multiplies <em class="parameter"><code>matrix</code></em> by the given frustum perspective matrix.</p>
183
182
<div class="variablelist"><table border="0">
184
183
<col align="left" valign="top">
185
184
<tbody>
224
223
<hr>
225
224
<div class="refsect2" title="cogl_matrix_ortho ()">
226
225
<a name="cogl-matrix-ortho"></a><h3>cogl_matrix_ortho ()</h3>
227
 
<pre class="programlisting">void                cogl_matrix_ortho                   (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
228
 
                                                         float left,
229
 
                                                         float right,
230
 
                                                         float bottom,
231
 
                                                         float top,
232
 
                                                         float z_near,
233
 
                                                         float z_far);</pre>
234
 
<p>
235
 
Multiples the matrix by a parallel projection matrix.</p>
236
 
<p>
237
 
</p>
 
226
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_matrix_ortho                   (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
227
                                                         <span class="returnvalue">float</span> left,
 
228
                                                         <span class="returnvalue">float</span> right,
 
229
                                                         <span class="returnvalue">float</span> bottom,
 
230
                                                         <span class="returnvalue">float</span> top,
 
231
                                                         <span class="returnvalue">float</span> z_near,
 
232
                                                         <span class="returnvalue">float</span> z_far);</pre>
 
233
<p>
 
234
Multiplies <em class="parameter"><code>matrix</code></em> by a parallel projection matrix.</p>
238
235
<div class="variablelist"><table border="0">
239
236
<col align="left" valign="top">
240
237
<tbody>
266
263
<tr>
267
264
<td><p><span class="term"><em class="parameter"><code>z_near</code></em> :</span></p></td>
268
265
<td> The coordinate for the near clipping plane (may be negative if
269
 
         the plane is behind the viewer)
 
266
  the plane is behind the viewer)
270
267
</td>
271
268
</tr>
272
269
<tr>
273
270
<td><p><span class="term"><em class="parameter"><code>z_far</code></em> :</span></p></td>
274
271
<td> The coordinate for the far clipping plane (may be negative if
275
 
        the plane is behind the viewer)
 
272
  the plane is behind the viewer)
276
273
</td>
277
274
</tr>
278
275
</tbody>
281
278
<hr>
282
279
<div class="refsect2" title="cogl_matrix_perspective ()">
283
280
<a name="cogl-matrix-perspective"></a><h3>cogl_matrix_perspective ()</h3>
284
 
<pre class="programlisting">void                cogl_matrix_perspective             (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
285
 
                                                         float fov_y,
286
 
                                                         float aspect,
287
 
                                                         float z_near,
288
 
                                                         float z_far);</pre>
289
 
<p>
290
 
Multiplies the matrix by the described perspective matrix
291
 
</p>
292
 
<p>
293
 
Note: you should be careful not to have to great a <em class="parameter"><code>z_far</code></em> / <em class="parameter"><code>z_near</code></em> ratio
 
281
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_matrix_perspective             (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
282
                                                         <span class="returnvalue">float</span> fov_y,
 
283
                                                         <span class="returnvalue">float</span> aspect,
 
284
                                                         <span class="returnvalue">float</span> z_near,
 
285
                                                         <span class="returnvalue">float</span> z_far);</pre>
 
286
<p>
 
287
Multiplies <em class="parameter"><code>matrix</code></em> by the described perspective matrix
 
288
</p>
 
289
<p>
 
290
</p>
 
291
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
 
292
<h3 class="title">Note</h3>You should be careful not to have to great a <em class="parameter"><code>z_far</code></em> / <em class="parameter"><code>z_near</code></em> ratio
294
293
since that will reduce the effectiveness of depth testing since there wont
295
 
be enough precision to identify the depth of objects near to each other.</p>
296
 
<p>
297
 
</p>
 
294
be enough precision to identify the depth of objects near to each
 
295
other.</div>
298
296
<div class="variablelist"><table border="0">
299
297
<col align="left" valign="top">
300
298
<tbody>
311
309
<tr>
312
310
<td><p><span class="term"><em class="parameter"><code>aspect</code></em> :</span></p></td>
313
311
<td> The ratio of width to height determining the field of view angle
314
 
         for the x axis.
 
312
  for the x axis.
315
313
</td>
316
314
</tr>
317
315
<tr>
318
316
<td><p><span class="term"><em class="parameter"><code>z_near</code></em> :</span></p></td>
319
 
<td> The distance to the near clip plane.
320
 
         Never pass 0 and always pass a positive number.
 
317
<td> The distance to the near clip plane. Never pass 0 and always pass
 
318
  a positive number.
321
319
</td>
322
320
</tr>
323
321
<tr>
331
329
<hr>
332
330
<div class="refsect2" title="cogl_matrix_transform_point ()">
333
331
<a name="cogl-matrix-transform-point"></a><h3>cogl_matrix_transform_point ()</h3>
334
 
<pre class="programlisting">void                cogl_matrix_transform_point         (const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
335
 
                                                         float *x,
336
 
                                                         float *y,
337
 
                                                         float *z,
338
 
                                                         float *w);</pre>
339
 
<p>
340
 
This transforms a point whos position is given and returned
341
 
as four float components.</p>
342
 
<p>
343
 
</p>
 
332
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_matrix_transform_point         (const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
333
                                                         <span class="returnvalue">float</span> *x,
 
334
                                                         <span class="returnvalue">float</span> *y,
 
335
                                                         <span class="returnvalue">float</span> *z,
 
336
                                                         <span class="returnvalue">float</span> *w);</pre>
 
337
<p>
 
338
Transforms a point whos position is given and returned as four float
 
339
components.</p>
344
340
<div class="variablelist"><table border="0">
345
341
<col align="left" valign="top">
346
342
<tbody>
351
347
</tr>
352
348
<tr>
353
349
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
354
 
<td> The X component of your points position [in:out]
355
 
</td>
 
350
<td> The X component of your points position. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=in-out"><span class="acronym">in-out</span></a>. </td>
356
351
</tr>
357
352
<tr>
358
353
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
359
 
<td> The Y component of your points position [in:out]
360
 
</td>
 
354
<td> The Y component of your points position. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=in-out"><span class="acronym">in-out</span></a>. </td>
361
355
</tr>
362
356
<tr>
363
357
<td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
364
 
<td> The Z component of your points position [in:out]
365
 
</td>
 
358
<td> The Z component of your points position. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=in-out"><span class="acronym">in-out</span></a>. </td>
366
359
</tr>
367
360
<tr>
368
361
<td><p><span class="term"><em class="parameter"><code>w</code></em> :</span></p></td>
369
 
<td> The W component of your points position [in:out]
370
 
</td>
 
362
<td> The W component of your points position. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=in-out"><span class="acronym">in-out</span></a>. </td>
371
363
</tr>
372
364
</tbody>
373
365
</table></div>
375
367
<hr>
376
368
<div class="refsect2" title="cogl_matrix_multiply ()">
377
369
<a name="cogl-matrix-multiply"></a><h3>cogl_matrix_multiply ()</h3>
378
 
<pre class="programlisting">void                cogl_matrix_multiply                (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *result,
379
 
                                                         const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *a,
380
 
                                                         const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *b);</pre>
381
 
<p>
382
 
This function multiples the two supplied matricies together and stores
383
 
the result in <em class="parameter"><code>result</code></em></p>
384
 
<p>
385
 
</p>
 
370
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_matrix_multiply                (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *result,
 
371
                                                         const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *a,
 
372
                                                         const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *b);</pre>
 
373
<p>
 
374
Multiplies the two supplied matrices together and stores
 
375
the resulting matrix inside <em class="parameter"><code>result</code></em></p>
386
376
<div class="variablelist"><table border="0">
387
377
<col align="left" valign="top">
388
378
<tbody>
407
397
<hr>
408
398
<div class="refsect2" title="cogl_matrix_rotate ()">
409
399
<a name="cogl-matrix-rotate"></a><h3>cogl_matrix_rotate ()</h3>
410
 
<pre class="programlisting">void                cogl_matrix_rotate                  (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
411
 
                                                         float angle,
412
 
                                                         float x,
413
 
                                                         float y,
414
 
                                                         float z);</pre>
415
 
<p>
416
 
This function multiples your matrix with a rotation matrix that applies
417
 
a rotation of <span class="type">angle</span> degrees around the specified 3D vector.</p>
418
 
<p>
419
 
</p>
 
400
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_matrix_rotate                  (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
401
                                                         <span class="returnvalue">float</span> angle,
 
402
                                                         <span class="returnvalue">float</span> x,
 
403
                                                         <span class="returnvalue">float</span> y,
 
404
                                                         <span class="returnvalue">float</span> z);</pre>
 
405
<p>
 
406
Multiplies <em class="parameter"><code>matrix</code></em> with a rotation matrix that applies a rotation
 
407
of <em class="parameter"><code>angle</code></em> degrees around the specified 3D vector.</p>
420
408
<div class="variablelist"><table border="0">
421
409
<col align="left" valign="top">
422
410
<tbody>
451
439
<hr>
452
440
<div class="refsect2" title="cogl_matrix_translate ()">
453
441
<a name="cogl-matrix-translate"></a><h3>cogl_matrix_translate ()</h3>
454
 
<pre class="programlisting">void                cogl_matrix_translate               (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
455
 
                                                         float x,
456
 
                                                         float y,
457
 
                                                         float z);</pre>
 
442
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_matrix_translate               (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
443
                                                         <span class="returnvalue">float</span> x,
 
444
                                                         <span class="returnvalue">float</span> y,
 
445
                                                         <span class="returnvalue">float</span> z);</pre>
458
446
<p>
459
 
</p>
 
447
Multiplies <em class="parameter"><code>matrix</code></em> with a transform matrix that translates along
 
448
the X, Y and Z axis.</p>
460
449
<div class="variablelist"><table border="0">
461
450
<col align="left" valign="top">
462
451
<tbody>
463
452
<tr>
464
453
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
465
 
<td>
 
454
<td> A 4x4 transformation matrix
466
455
</td>
467
456
</tr>
468
457
<tr>
469
458
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
470
 
<td>
 
459
<td> The X translation you want to apply
471
460
</td>
472
461
</tr>
473
462
<tr>
474
463
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
475
 
<td>
 
464
<td> The Y translation you want to apply
476
465
</td>
477
466
</tr>
478
467
<tr>
479
468
<td><p><span class="term"><em class="parameter"><code>z</code></em> :</span></p></td>
480
 
<td>
 
469
<td> The Z translation you want to apply
481
470
</td>
482
471
</tr>
483
472
</tbody>
486
475
<hr>
487
476
<div class="refsect2" title="cogl_matrix_scale ()">
488
477
<a name="cogl-matrix-scale"></a><h3>cogl_matrix_scale ()</h3>
489
 
<pre class="programlisting">void                cogl_matrix_scale                   (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
490
 
                                                         float sx,
491
 
                                                         float sy,
492
 
                                                         float sz);</pre>
493
 
<p>
494
 
This function multiples your matrix with a transform matrix that scales
495
 
along the X, Y and Z axis.</p>
496
 
<p>
497
 
</p>
 
478
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_matrix_scale                   (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
479
                                                         <span class="returnvalue">float</span> sx,
 
480
                                                         <span class="returnvalue">float</span> sy,
 
481
                                                         <span class="returnvalue">float</span> sz);</pre>
 
482
<p>
 
483
Multiplies <em class="parameter"><code>matrix</code></em> with a transform matrix that scales along the X,
 
484
Y and Z axis.</p>
498
485
<div class="variablelist"><table border="0">
499
486
<col align="left" valign="top">
500
487
<tbody>
524
511
<hr>
525
512
<div class="refsect2" title="cogl_matrix_init_from_array ()">
526
513
<a name="cogl-matrix-init-from-array"></a><h3>cogl_matrix_init_from_array ()</h3>
527
 
<pre class="programlisting">void                cogl_matrix_init_from_array         (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix,
528
 
                                                         const float *array);</pre>
529
 
<p>
530
 
This initialises <em class="parameter"><code>matrix</code></em> with the contents of <em class="parameter"><code>array</code></em></p>
531
 
<p>
532
 
</p>
 
514
<pre class="programlisting"><span class="returnvalue">void</span>                cogl_matrix_init_from_array         (<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
515
                                                         const <span class="returnvalue">float</span> *array);</pre>
 
516
<p>
 
517
Initializes <em class="parameter"><code>matrix</code></em> with the contents of <em class="parameter"><code>array</code></em></p>
533
518
<div class="variablelist"><table border="0">
534
519
<col align="left" valign="top">
535
520
<tbody>
549
534
<hr>
550
535
<div class="refsect2" title="cogl_matrix_get_array ()">
551
536
<a name="cogl-matrix-get-array"></a><h3>cogl_matrix_get_array ()</h3>
552
 
<pre class="programlisting">const float *       cogl_matrix_get_array               (const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix">CoglMatrix</a> *matrix);</pre>
553
 
<p>
554
 
This casts a CoglMatrix to a float array which can be directly passed to
555
 
OpenGL.</p>
556
 
<p>
557
 
</p>
 
537
<pre class="programlisting">const <span class="returnvalue">float</span> *       cogl_matrix_get_array               (const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix);</pre>
 
538
<p>
 
539
Casts <em class="parameter"><code>matrix</code></em> to a float array which can be directly passed to OpenGL.</p>
558
540
<div class="variablelist"><table border="0">
559
541
<col align="left" valign="top">
560
542
<tbody>
571
553
</tbody>
572
554
</table></div>
573
555
</div>
 
556
<hr>
 
557
<div class="refsect2" title="cogl_matrix_get_inverse ()">
 
558
<a name="cogl-matrix-get-inverse"></a><h3>cogl_matrix_get_inverse ()</h3>
 
559
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            cogl_matrix_get_inverse             (const <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *matrix,
 
560
                                                         <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="returnvalue">CoglMatrix</span></a> *inverse);</pre>
 
561
<p>
 
562
Gets the inverse transform of a given matrix and uses it to initialize
 
563
a new <a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a>.
 
564
</p>
 
565
<p>
 
566
</p>
 
567
<div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;">
 
568
<h3 class="title">Note</h3>Although the first parameter is annotated as const to indicate
 
569
that the transform it represents isn't modified this function may
 
570
technically save a copy of the inverse transform within the given
 
571
<a class="link" href="cogl-Matrices.html#CoglMatrix" title="CoglMatrix"><span class="type">CoglMatrix</span></a> so that subsequent requests for the inverse transform may
 
572
avoid costly inversion calculations.</div>
 
573
<div class="variablelist"><table border="0">
 
574
<col align="left" valign="top">
 
575
<tbody>
 
576
<tr>
 
577
<td><p><span class="term"><em class="parameter"><code>matrix</code></em> :</span></p></td>
 
578
<td> A 4x4 transformation matrix
 
579
</td>
 
580
</tr>
 
581
<tr>
 
582
<td><p><span class="term"><em class="parameter"><code>inverse</code></em> :</span></p></td>
 
583
<td> The destination for a 4x4 inverse transformation matrix. <a href="http://foldoc.doc.ic.ac.uk/foldoc/foldoc.cgi?query=out"><span class="acronym">out</span></a>. </td>
 
584
</tr>
 
585
<tr>
 
586
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
 
587
<td> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the inverse was successfully calculated or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>
 
588
  for degenerate transformations that can't be inverted (in this case the
 
589
  <em class="parameter"><code>inverse</code></em> matrix will simply be initialized with the identity matrix)
 
590
 
 
591
</td>
 
592
</tr>
 
593
</tbody>
 
594
</table></div>
 
595
<p class="since">Since 1.2</p>
 
596
</div>
574
597
</div>
575
598
</div>
576
599
<div class="footer">
577
600
<hr>
578
 
          Generated by GTK-Doc V1.11</div>
 
601
          Generated by GTK-Doc V1.13</div>
579
602
</body>
580
 
</html>
 
603
</html>
 
 
b'\\ No newline at end of file'