提交 9c57b1e4 编写于 作者: B Ben Houston

Matrix4.extractBasis, Matrix4.makeBasis - very useful for messing around with orientations.

上级 d1ae0510
......@@ -90,6 +90,31 @@ THREE.Matrix4.prototype = {
},
extractBasis: function ( xAxis, yAxis, zAxis ) {
var te = this.elements;
xAxis.set( te[0], te[1], te[2] );
yAxis.set( te[4], te[5], te[6] );
zAxis.set( te[8], te[9], te[10] );
return this;
},
makeBasis: function ( xAxis, yAxis, zAxis ) {
this.identity();
var te = this.elements;
te.elements[0] = xAxis.x; te.elements[1] = xAxis.y; te.elements[2] = xAxis.z;
te.elements[4] = yAxis.x; te.elements[5] = yAxis.y; te.elements[6] = yAxis.z;
te.elements[8] = zAxis.x; te.elements[9] = zAxis.y; te.elements[10] = zAxis.z;
return this;
},
extractRotation: function () {
var v1 = new THREE.Vector3();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册