var rotationMatrix = new THREE.Matrix4();
var position = new THREE.Vector3( 1000, 1000, 0 );
var angle = Math.PI / 4;
var axis = new THREE.Vector3( 1, 0.5, 0 ).normalize();
function render() {
/** Adds a rotation of rad to the obj's rotation about world's axis */
rotationMatrix.makeRotationAxis( axis, angle ).multiplyVector3( position );
tubeMesh.matrix = rotationMatrix;
tubeMesh.rotation.getRotationFromMatrix(rotationMatrix, tubeMesh.scale);
renderer.render( scene, camera );
}
我已使用以下网址中的代码:
我收到错误“Uncaught TypeError:无法调用方法'makeRotationAxis'未定义”。此处rotationMatrix
定义为THREE.Matrix4()
,它与上述链接中给出的代码相同。我正在使用three.js库的r51。