0
    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 );
                    }

これらの URL からこのコードを使用しました。

「Uncaught TypeError: 未定義のメソッド 'makeRotationAxis' を呼び出せません」というエラーが表示されます。ここでrotationMatrixは として定義されてTHREE.Matrix4()おり、上記のリンクに示されているコードと同じです。three.js ライブラリの r51 を使用しています。

4

0 に答える 0