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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
|
page.title=RenderScript Matrix Functions
@jd:body
<div class='renderscript'>
<h2>Overview</h2>
<p> These functions let you manipulate square matrices of rank 2x2, 3x3, and 4x4.
They are particularly useful for graphical transformations and are compatible
with OpenGL.
</p>
<p> We use a zero-based index for rows and columns. E.g. the last element of a
<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a> is found at (3, 3).
</p>
<p> RenderScript uses column-major matrices and column-based vectors. Transforming
a vector is done by postmultiplying the vector, e.g. <code>(matrix * vector)</code>,
as provided by <a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>().
</p>
<p> To create a transformation matrix that performs two transformations at once,
multiply the two source matrices, with the first transformation as the right
argument. E.g. to create a transformation matrix that applies the
transformation s1 followed by s2, call <code>rsMatrixLoadMultiply(&combined, &s2, &s1)</code>.
This derives from <code>s2 * (s1 * v)</code>, which is <code>(s2 * s1) * v</code>.
</p>
<p> We have two style of functions to create transformation matrices:
rsMatrixLoad<i>Transformation</i> and rsMatrix<i>Transformation</i>. The former
style simply stores the transformation matrix in the first argument. The latter
modifies a pre-existing transformation matrix so that the new transformation
happens first. E.g. if you call <a href='rs_matrix.html#android_rs:rsMatrixTranslate'>rsMatrixTranslate</a>() on a matrix that already
does a scaling, the resulting matrix when applied to a vector will first do the
translation then the scaling.
</p>
<h2>Summary</h2>
<table class='jd-sumtable'><tbody>
<tr><th colspan='2'>Functions</th></tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsExtractFrustumPlanes'>rsExtractFrustumPlanes</a>
</td>
<td class='jd-descrcol' width='100%'>
Compute frustum planes
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsIsSphereInFrustum'>rsIsSphereInFrustum</a>
</td>
<td class='jd-descrcol' width='100%'>
Checks if a sphere is within the frustum planes
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixGet'>rsMatrixGet</a>
</td>
<td class='jd-descrcol' width='100%'>
Get one element
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixInverse'>rsMatrixInverse</a>
</td>
<td class='jd-descrcol' width='100%'>
Inverts a matrix in place
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixInverseTranspose'>rsMatrixInverseTranspose</a>
</td>
<td class='jd-descrcol' width='100%'>
Inverts and transpose a matrix in place
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixLoad'>rsMatrixLoad</a>
</td>
<td class='jd-descrcol' width='100%'>
Load or copy a matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixLoadFrustum'>rsMatrixLoadFrustum</a>
</td>
<td class='jd-descrcol' width='100%'>
Load a frustum projection matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixLoadIdentity'>rsMatrixLoadIdentity</a>
</td>
<td class='jd-descrcol' width='100%'>
Load identity matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixLoadMultiply'>rsMatrixLoadMultiply</a>
</td>
<td class='jd-descrcol' width='100%'>
Multiply two matrices
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixLoadOrtho'>rsMatrixLoadOrtho</a>
</td>
<td class='jd-descrcol' width='100%'>
Load an orthographic projection matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixLoadPerspective'>rsMatrixLoadPerspective</a>
</td>
<td class='jd-descrcol' width='100%'>
Load a perspective projection matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixLoadRotate'>rsMatrixLoadRotate</a>
</td>
<td class='jd-descrcol' width='100%'>
Load a rotation matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixLoadScale'>rsMatrixLoadScale</a>
</td>
<td class='jd-descrcol' width='100%'>
Load a scaling matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixLoadTranslate'>rsMatrixLoadTranslate</a>
</td>
<td class='jd-descrcol' width='100%'>
Load a translation matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>
</td>
<td class='jd-descrcol' width='100%'>
Multiply a matrix by a vector or another matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixRotate'>rsMatrixRotate</a>
</td>
<td class='jd-descrcol' width='100%'>
Apply a rotation to a transformation matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixScale'>rsMatrixScale</a>
</td>
<td class='jd-descrcol' width='100%'>
Apply a scaling to a transformation matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixSet'>rsMatrixSet</a>
</td>
<td class='jd-descrcol' width='100%'>
Set one element
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixTranslate'>rsMatrixTranslate</a>
</td>
<td class='jd-descrcol' width='100%'>
Apply a translation to a transformation matrix
</td>
</tr>
<tr class='alt-color api apilevel-1'>
<td class='jd-linkcol'>
<a href='rs_matrix.html#android_rs:rsMatrixTranspose'>rsMatrixTranspose</a>
</td>
<td class='jd-descrcol' width='100%'>
Transpose a matrix place
</td>
</tr>
</tbody></table>
<h2>Functions</h2>
<a name='android_rs:rsExtractFrustumPlanes'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsExtractFrustumPlanes</span>
<span class='normal'>: Compute frustum planes</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsExtractFrustumPlanes(const <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* viewProj, <a href='rs_value_types.html#android_rs:float4'>float4</a>* left, <a href='rs_value_types.html#android_rs:float4'>float4</a>* right, <a href='rs_value_types.html#android_rs:float4'>float4</a>* top, <a href='rs_value_types.html#android_rs:float4'>float4</a>* bottom, <a href='rs_value_types.html#android_rs:float4'>float4</a>* near, <a href='rs_value_types.html#android_rs:float4'>float4</a>* far);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>viewProj</th><td>Matrix to extract planes from.</td></tr>
<tr><th>left</th><td>Left plane.</td></tr>
<tr><th>right</th><td>Right plane.</td></tr>
<tr><th>top</th><td>Top plane.</td></tr>
<tr><th>bottom</th><td>Bottom plane.</td></tr>
<tr><th>near</th><td>Near plane.</td></tr>
<tr><th>far</th><td>Far plane.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Computes 6 frustum planes from the view projection matrix
</p>
</div>
</div>
<a name='android_rs:rsIsSphereInFrustum'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsIsSphereInFrustum</span>
<span class='normal'>: Checks if a sphere is within the frustum planes</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>bool rsIsSphereInFrustum(<a href='rs_value_types.html#android_rs:float4'>float4</a>* sphere, <a href='rs_value_types.html#android_rs:float4'>float4</a>* left, <a href='rs_value_types.html#android_rs:float4'>float4</a>* right, <a href='rs_value_types.html#android_rs:float4'>float4</a>* top, <a href='rs_value_types.html#android_rs:float4'>float4</a>* bottom, <a href='rs_value_types.html#android_rs:float4'>float4</a>* near, <a href='rs_value_types.html#android_rs:float4'>float4</a>* far);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>sphere</th><td>float4 representing the sphere.</td></tr>
<tr><th>left</th><td>Left plane.</td></tr>
<tr><th>right</th><td>Right plane.</td></tr>
<tr><th>top</th><td>Top plane.</td></tr>
<tr><th>bottom</th><td>Bottom plane.</td></tr>
<tr><th>near</th><td>Near plane.</td></tr>
<tr><th>far</th><td>Far plane.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns true if the sphere is within the 6 frustum planes.
</p>
</div>
</div>
<a name='android_rs:rsMatrixGet'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixGet</span>
<span class='normal'>: Get one element</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>float rsMatrixGet(const <a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* m, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> col, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> row);
</td>
<td> </td>
</tr>
<tr>
<td>float rsMatrixGet(const <a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* m, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> col, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> row);
</td>
<td> </td>
</tr>
<tr>
<td>float rsMatrixGet(const <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> col, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> row);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to extract the element from.</td></tr>
<tr><th>col</th><td>Zero-based column of the element to be extracted.</td></tr>
<tr><th>row</th><td>Zero-based row of the element to extracted.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns one element of a matrix.
</p>
<p> <b>Warning:</b> The order of the column and row parameters may be unexpected.
</p>
</div>
</div>
<a name='android_rs:rsMatrixInverse'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixInverse</span>
<span class='normal'>: Inverts a matrix in place</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>bool rsMatrixInverse(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to invert.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Returns true if the matrix was successfully inverted.
</p>
</div>
</div>
<a name='android_rs:rsMatrixInverseTranspose'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixInverseTranspose</span>
<span class='normal'>: Inverts and transpose a matrix in place</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>bool rsMatrixInverseTranspose(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to modify.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> The matrix is first inverted then transposed. Returns true if the matrix was
successfully inverted.
</p>
</div>
</div>
<a name='android_rs:rsMatrixLoad'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixLoad</span>
<span class='normal'>: Load or copy a matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixLoad(<a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* destination, const float* array);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoad(<a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* destination, const <a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* source);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoad(<a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* destination, const float* array);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoad(<a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* destination, const <a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* source);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoad(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* destination, const float* array);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoad(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* destination, const <a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* source);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoad(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* destination, const <a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* source);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoad(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* destination, const <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* source);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>destination</th><td>Matrix to set.</td></tr>
<tr><th>array</th><td>Array of values to set the matrix to. These arrays should be 4, 9, or 16 floats long, depending on the matrix size.</td></tr>
<tr><th>source</th><td>Source matrix.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Set the elements of a matrix from an array of floats or from another matrix.
</p>
<p> If loading from an array, the floats should be in row-major order, i.e. the element a
<code>row 0, column 0</code> should be first, followed by the element at
<code>row 0, column 1</code>, etc.
</p>
<p> If loading from a matrix and the source is smaller than the destination, the rest
of the destination is filled with elements of the identity matrix. E.g.
loading a rs_matrix2x2 into a rs_matrix4x4 will give:
<table style="max-width:300px">
<tr><td>m00</td> <td>m01</td> <td>0.0</td> <td>0.0</td></tr>
<tr><td>m10</td> <td>m11</td> <td>0.0</td> <td>0.0</td></tr>
<tr><td>0.0</td> <td>0.0</td> <td>1.0</td> <td>0.0</td></tr>
<tr><td>0.0</td> <td>0.0</td> <td>0.0</td> <td>1.0</td></tr>
</table>
</p>
</div>
</div>
<a name='android_rs:rsMatrixLoadFrustum'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixLoadFrustum</span>
<span class='normal'>: Load a frustum projection matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixLoadFrustum(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, float left, float right, float bottom, float top, float near, float far);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to set.</td></tr>
<tr><th>left</th><td></td></tr>
<tr><th>right</th><td></td></tr>
<tr><th>bottom</th><td></td></tr>
<tr><th>top</th><td></td></tr>
<tr><th>near</th><td></td></tr>
<tr><th>far</th><td></td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Constructs a frustum projection matrix, transforming the box identified by
the six clipping planes <code>left, right, bottom, top, near, far</code>.
</p>
<p> To apply this projection to a vector, multiply the vector by the created
matrix using <a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>().
</p>
</div>
</div>
<a name='android_rs:rsMatrixLoadIdentity'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixLoadIdentity</span>
<span class='normal'>: Load identity matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixLoadIdentity(<a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* m);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoadIdentity(<a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* m);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoadIdentity(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to set.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Set the elements of a matrix to the identity matrix.
</p>
</div>
</div>
<a name='android_rs:rsMatrixLoadMultiply'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixLoadMultiply</span>
<span class='normal'>: Multiply two matrices</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixLoadMultiply(<a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* m, const <a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* lhs, const <a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* rhs);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoadMultiply(<a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* m, const <a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* lhs, const <a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* rhs);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixLoadMultiply(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, const <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* lhs, const <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* rhs);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to set.</td></tr>
<tr><th>lhs</th><td>Left matrix of the product.</td></tr>
<tr><th>rhs</th><td>Right matrix of the product.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Sets m to the matrix product of <code>lhs * rhs</code>.
</p>
<p> To combine two 4x4 transformaton matrices, multiply the second transformation matrix
by the first transformation matrix. E.g. to create a transformation matrix that applies
the transformation s1 followed by s2, call <code>rsMatrixLoadMultiply(&combined, &s2, &s1)</code>.
</p>
<p> <b>Warning:</b> Prior to version 21, storing the result back into right matrix is not supported and
will result in undefined behavior. Use rsMatrixMulitply instead. E.g. instead of doing
rsMatrixLoadMultiply (&m2r, &m2r, &m2l), use rsMatrixMultiply (&m2r, &m2l).
rsMatrixLoadMultiply (&m2l, &m2r, &m2l) works as expected.
</p>
</div>
</div>
<a name='android_rs:rsMatrixLoadOrtho'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixLoadOrtho</span>
<span class='normal'>: Load an orthographic projection matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixLoadOrtho(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, float left, float right, float bottom, float top, float near, float far);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to set.</td></tr>
<tr><th>left</th><td></td></tr>
<tr><th>right</th><td></td></tr>
<tr><th>bottom</th><td></td></tr>
<tr><th>top</th><td></td></tr>
<tr><th>near</th><td></td></tr>
<tr><th>far</th><td></td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Constructs an orthographic projection matrix, transforming the box identified by the
six clipping planes <code>left, right, bottom, top, near, far</code> into a unit cube
with a corner at <code>(-1, -1, -1)</code> and the opposite at <code>(1, 1, 1)</code>.
</p>
<p> To apply this projection to a vector, multiply the vector by the created matrix
using <a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>().
</p>
<p> See https://en.wikipedia.org/wiki/Orthographic_projection .
</p>
</div>
</div>
<a name='android_rs:rsMatrixLoadPerspective'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixLoadPerspective</span>
<span class='normal'>: Load a perspective projection matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixLoadPerspective(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, float fovy, float aspect, float near, float far);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to set.</td></tr>
<tr><th>fovy</th><td>Field of view, in degrees along the Y axis.</td></tr>
<tr><th>aspect</th><td>Ratio of x / y.</td></tr>
<tr><th>near</th><td>Near clipping plane.</td></tr>
<tr><th>far</th><td>Far clipping plane.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Constructs a perspective projection matrix, assuming a symmetrical field of view.
</p>
<p> To apply this projection to a vector, multiply the vector by the created matrix
using <a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>().
</p>
</div>
</div>
<a name='android_rs:rsMatrixLoadRotate'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixLoadRotate</span>
<span class='normal'>: Load a rotation matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixLoadRotate(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, float rot, float x, float y, float z);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to set.</td></tr>
<tr><th>rot</th><td>How much rotation to do, in degrees.</td></tr>
<tr><th>x</th><td>X component of the vector that is the axis of rotation.</td></tr>
<tr><th>y</th><td>Y component of the vector that is the axis of rotation.</td></tr>
<tr><th>z</th><td>Z component of the vector that is the axis of rotation.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> This function creates a rotation matrix. The axis of rotation is the <code>(x, y, z)</code> vector.
</p>
<p> To rotate a vector, multiply the vector by the created matrix using <a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>().
</p>
<p> See http://en.wikipedia.org/wiki/Rotation_matrix .
</p>
</div>
</div>
<a name='android_rs:rsMatrixLoadScale'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixLoadScale</span>
<span class='normal'>: Load a scaling matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixLoadScale(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, float x, float y, float z);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to set.</td></tr>
<tr><th>x</th><td>Multiple to scale the x components by.</td></tr>
<tr><th>y</th><td>Multiple to scale the y components by.</td></tr>
<tr><th>z</th><td>Multiple to scale the z components by.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> This function creates a scaling matrix, where each component of a vector is multiplied
by a number. This number can be negative.
</p>
<p> To scale a vector, multiply the vector by the created matrix using <a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>().
</p>
</div>
</div>
<a name='android_rs:rsMatrixLoadTranslate'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixLoadTranslate</span>
<span class='normal'>: Load a translation matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixLoadTranslate(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, float x, float y, float z);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to set.</td></tr>
<tr><th>x</th><td>Number to add to each x component.</td></tr>
<tr><th>y</th><td>Number to add to each y component.</td></tr>
<tr><th>z</th><td>Number to add to each z component.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> This function creates a translation matrix, where a number is added to each element of
a vector.
</p>
<p> To translate a vector, multiply the vector by the created matrix using
<a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>().
</p>
</div>
</div>
<a name='android_rs:rsMatrixMultiply'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixMultiply</span>
<span class='normal'>: Multiply a matrix by a vector or another matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td><a href='rs_value_types.html#android_rs:float2'>float2</a> rsMatrixMultiply(const <a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* m, <a href='rs_value_types.html#android_rs:float2'>float2</a> in);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float2'>float2</a> rsMatrixMultiply(<a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* m, <a href='rs_value_types.html#android_rs:float2'>float2</a> in);
</td>
<td> Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float3'>float3</a> rsMatrixMultiply(const <a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* m, <a href='rs_value_types.html#android_rs:float2'>float2</a> in);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float3'>float3</a> rsMatrixMultiply(const <a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* m, <a href='rs_value_types.html#android_rs:float3'>float3</a> in);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float3'>float3</a> rsMatrixMultiply(<a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* m, <a href='rs_value_types.html#android_rs:float2'>float2</a> in);
</td>
<td> Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float3'>float3</a> rsMatrixMultiply(<a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* m, <a href='rs_value_types.html#android_rs:float3'>float3</a> in);
</td>
<td> Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float4'>float4</a> rsMatrixMultiply(const <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, <a href='rs_value_types.html#android_rs:float2'>float2</a> in);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float4'>float4</a> rsMatrixMultiply(const <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, <a href='rs_value_types.html#android_rs:float3'>float3</a> in);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float4'>float4</a> rsMatrixMultiply(const <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, <a href='rs_value_types.html#android_rs:float4'>float4</a> in);
</td>
<td> Added in <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float4'>float4</a> rsMatrixMultiply(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, <a href='rs_value_types.html#android_rs:float2'>float2</a> in);
</td>
<td> Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float4'>float4</a> rsMatrixMultiply(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, <a href='rs_value_types.html#android_rs:float3'>float3</a> in);
</td>
<td> Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td><a href='rs_value_types.html#android_rs:float4'>float4</a> rsMatrixMultiply(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, <a href='rs_value_types.html#android_rs:float4'>float4</a> in);
</td>
<td> Removed from <a href='http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels'>API level 14</a>
</td>
</tr>
<tr>
<td>void rsMatrixMultiply(<a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* m, const <a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* rhs);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixMultiply(<a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* m, const <a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* rhs);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixMultiply(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, const <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* rhs);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Left matrix of the product and the matrix to be set.</td></tr>
<tr><th>rhs</th><td>Right matrix of the product.</td></tr>
<tr><th>in</th><td></td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> For the matrix by matrix variant, sets m to the matrix product <code>m * rhs</code>.
</p>
<p> When combining two 4x4 transformation matrices using this function, the resulting
matrix will correspond to performing the rhs transformation first followed by
the original m transformation.
</p>
<p> For the matrix by vector variant, returns the post-multiplication of the vector
by the matrix, ie. <code>m * in</code>.
</p>
<p> When multiplying a float3 to a <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>, the vector is expanded with (1).
</p>
<p> When multiplying a float2 to a <a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>, the vector is expanded with (0, 1).
</p>
<p> When multiplying a float2 to a <a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>, the vector is expanded with (0).
</p>
<p> Starting with API 14, this function takes a const matrix as the first argument.
</p>
</div>
</div>
<a name='android_rs:rsMatrixRotate'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixRotate</span>
<span class='normal'>: Apply a rotation to a transformation matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixRotate(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, float rot, float x, float y, float z);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to modify.</td></tr>
<tr><th>rot</th><td>How much rotation to do, in degrees.</td></tr>
<tr><th>x</th><td>X component of the vector that is the axis of rotation.</td></tr>
<tr><th>y</th><td>Y component of the vector that is the axis of rotation.</td></tr>
<tr><th>z</th><td>Z component of the vector that is the axis of rotation.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Multiply the matrix m with a rotation matrix.
</p>
<p> This function modifies a transformation matrix to first do a rotation. The axis of
rotation is the <code>(x, y, z)</code> vector.
</p>
<p> To apply this combined transformation to a vector, multiply the vector by the created
matrix using <a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>().
</p>
</div>
</div>
<a name='android_rs:rsMatrixScale'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixScale</span>
<span class='normal'>: Apply a scaling to a transformation matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixScale(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, float x, float y, float z);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to modify.</td></tr>
<tr><th>x</th><td>Multiple to scale the x components by.</td></tr>
<tr><th>y</th><td>Multiple to scale the y components by.</td></tr>
<tr><th>z</th><td>Multiple to scale the z components by.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Multiply the matrix m with a scaling matrix.
</p>
<p> This function modifies a transformation matrix to first do a scaling. When scaling,
each component of a vector is multiplied by a number. This number can be negative.
</p>
<p> To apply this combined transformation to a vector, multiply the vector by the created
matrix using <a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>().
</p>
</div>
</div>
<a name='android_rs:rsMatrixSet'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixSet</span>
<span class='normal'>: Set one element</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixSet(<a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* m, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> col, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> row, float v);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixSet(<a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* m, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> col, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> row, float v);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixSet(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> col, <a href='rs_value_types.html#android_rs:uint32_t'>uint32_t</a> row, float v);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix that will be modified.</td></tr>
<tr><th>col</th><td>Zero-based column of the element to be set.</td></tr>
<tr><th>row</th><td>Zero-based row of the element to be set.</td></tr>
<tr><th>v</th><td>Value to set.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Set an element of a matrix.
</p>
<p> <b>Warning:</b> The order of the column and row parameters may be unexpected.
</p>
</div>
</div>
<a name='android_rs:rsMatrixTranslate'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixTranslate</span>
<span class='normal'>: Apply a translation to a transformation matrix</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixTranslate(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m, float x, float y, float z);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to modify.</td></tr>
<tr><th>x</th><td>Number to add to each x component.</td></tr>
<tr><th>y</th><td>Number to add to each y component.</td></tr>
<tr><th>z</th><td>Number to add to each z component.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Multiply the matrix m with a translation matrix.
</p>
<p> This function modifies a transformation matrix to first do a translation. When
translating, a number is added to each component of a vector.
</p>
<p> To apply this combined transformation to a vector, multiply the vector by the
created matrix using <a href='rs_matrix.html#android_rs:rsMatrixMultiply'>rsMatrixMultiply</a>().
</p>
</div>
</div>
<a name='android_rs:rsMatrixTranspose'></a>
<div class='jd-details'>
<h4 class='jd-details-title'>
<span class='sympad'>rsMatrixTranspose</span>
<span class='normal'>: Transpose a matrix place</span>
</h4>
<div class='jd-details-descr'>
<table class='jd-tagtable'><tbody>
<tr>
<td>void rsMatrixTranspose(<a href='rs_value_types.html#android_rs:rs_matrix2x2'>rs_matrix2x2</a>* m);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixTranspose(<a href='rs_value_types.html#android_rs:rs_matrix3x3'>rs_matrix3x3</a>* m);
</td>
<td> </td>
</tr>
<tr>
<td>void rsMatrixTranspose(<a href='rs_value_types.html#android_rs:rs_matrix4x4'>rs_matrix4x4</a>* m);
</td>
<td> </td>
</tr>
</tbody></table>
</div>
<div class='jd-tagdata'> <h5 class='jd-tagtitle'>Parameters</h5>
<table class='jd-tagtable'><tbody>
<tr><th>m</th><td>Matrix to transpose.</td></tr>
</tbody></table>
</div>
<div class='jd-tagdata jd-tagdescr'>
<p> Transpose the matrix m in place.
</p>
</div>
</div>
</div>
|