Bläddra i källkod

Set quaternion instead of rotation

WestLangley 6 år sedan
förälder
incheckning
49bb5d1fb8
2 ändrade filer med 3 tillägg och 3 borttagningar
  1. 2 2
      examples/css3d_molecules.html
  2. 1 1
      examples/webgl_geometry_extrude_splines.html

+ 2 - 2
examples/css3d_molecules.html

@@ -425,7 +425,7 @@
 
 						var objMatrix = new THREE.Matrix4().makeRotationAxis( axis.normalize(), radians );
 						object.matrix = objMatrix;
-						object.rotation.setFromRotationMatrix( object.matrix, object.rotation.order );
+						object.quaternion.setFromRotationMatrix( object.matrix );
 
 						object.matrixAutoUpdate = false;
 						object.updateMatrix();
@@ -445,7 +445,7 @@
 						joint.position.lerp( end, 0.5 );
 
 						joint.matrix.copy( objMatrix );
-						joint.rotation.setFromRotationMatrix( joint.matrix, joint.rotation.order );
+						joint.quaternion.setFromRotationMatrix( joint.matrix );
 
 						joint.matrixAutoUpdate = false;
 						joint.updateMatrix();

+ 1 - 1
examples/webgl_geometry_extrude_splines.html

@@ -323,7 +323,7 @@
 
 				if ( ! params.lookAhead ) lookAt.copy( pos ).add( dir );
 				splineCamera.matrix.lookAt( splineCamera.position, lookAt, normal );
-				splineCamera.rotation.setFromRotationMatrix( splineCamera.matrix, splineCamera.rotation.order );
+				splineCamera.quaternion.setFromRotationMatrix( splineCamera.matrix );
 
 				cameraHelper.update();