Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Matrix 以三个方向旋转矩阵_Matrix_Three.js_Rotation - Fatal编程技术网

Matrix 以三个方向旋转矩阵

Matrix 以三个方向旋转矩阵,matrix,three.js,rotation,Matrix,Three.js,Rotation,我必须手动构建对象worldmatrix,因为这比使用设置位置的方法更快、更优化。但我的问题是,我需要将矩阵旋转180度。makeRotationY(alpha)只是将旋转设置为180,而不考虑预先存在的旋转。我需要能够保留预先存在的旋转。所以如果矩阵有10个旋转,我用180个旋转,总数是190。我该怎么做 它目前的工作原理如下: var inverse_view_to_source = new THREE.Matrix4().getInverse(camera.matrix). m

我必须手动构建对象worldmatrix,因为这比使用设置位置的方法更快、更优化。但我的问题是,我需要将矩阵旋转180度。makeRotationY(alpha)只是将旋转设置为180,而不考虑预先存在的旋转。我需要能够保留预先存在的旋转。所以如果矩阵有10个旋转,我用180个旋转,总数是190。我该怎么做

它目前的工作原理如下:

   var inverse_view_to_source = new THREE.Matrix4().getInverse(camera.matrix).
   multiply(src_portal.matrix);
   inverse_view_to_source.makeRotationY(Math.PI);
   inverse_view_to_source = dst_portal.matrix.clone().multiply(inverse_view_to_source);