diff options
author | hwc487 | 2012-04-15 05:16:34 -0700 |
---|---|---|
committer | hwc487 | 2012-04-15 05:16:34 -0700 |
commit | 8992d9baf542135e910bb59328a592d9e330703a (patch) | |
tree | 268465b69fd37ec1dc33d304de959e79dc619ecd /js/lib/math | |
parent | 331b2ad4d602016f9bb3d03be759fd81fed50c10 (diff) | |
download | ninja-8992d9baf542135e910bb59328a592d9e330703a.tar.gz |
Cloud Material
Diffstat (limited to 'js/lib/math')
-rwxr-xr-x | js/lib/math/matrix.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/js/lib/math/matrix.js b/js/lib/math/matrix.js index 77a0966d..3a5a8215 100755 --- a/js/lib/math/matrix.js +++ b/js/lib/math/matrix.js | |||
@@ -67,6 +67,15 @@ Matrix.Rotation = function(angle, axis) { | |||
67 | return mat; | 67 | return mat; |
68 | }; | 68 | }; |
69 | 69 | ||
70 | Matrix.Scale = function( scaleVec ) { | ||
71 | var mat = Matrix.I(4); | ||
72 | mat[ 0] = scaleVec[0]; | ||
73 | mat[ 5] = scaleVec[1]; | ||
74 | mat[10] = scaleVec[2]; | ||
75 | |||
76 | return mat; | ||
77 | }; | ||
78 | |||
70 | Matrix.flatten = function (mat) { | 79 | Matrix.flatten = function (mat) { |
71 | var result = []; | 80 | var result = []; |
72 | if (this.elements.length == 0) { | 81 | if (this.elements.length == 0) { |