Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/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
Three.js 如何链矩阵变换操作?_Three.js - Fatal编程技术网

Three.js 如何链矩阵变换操作?

Three.js 如何链矩阵变换操作?,three.js,Three.js,为什么链接使矩阵上的翻译方法不起作用 boxMesh.matrixAutoUpdate = false boxMesh.matrix.makeTranslation(30, 0, 0) boxMesh.matrix.makeTranslation(30, 0, 0) 网格仅在x轴上移动30个单位,而不是60个单位 但是当我使用applyMatrix方法时,一切都按预期工作: boxMesh.applyMatrix(new THREE.Matrix

为什么链接
使
矩阵上的翻译方法不起作用

      boxMesh.matrixAutoUpdate = false
      boxMesh.matrix.makeTranslation(30, 0, 0)
      boxMesh.matrix.makeTranslation(30, 0, 0)
网格仅在x轴上移动30个单位,而不是60个单位

但是当我使用
applyMatrix
方法时,一切都按预期工作:

      boxMesh.applyMatrix(new THREE.Matrix4().makeTranslation(30, 0, 0))
      boxMesh.applyMatrix(new THREE.Matrix4().makeTranslation(30, 0, 0))
创建纯转换矩阵。将覆盖所有现有的矩阵元素。因此,该方法不打算将转换应用于现有变换矩阵

工作原理不同,因为它将给定矩阵与对象的局部变换矩阵相乘。这将导致给定转换和现有转换的结合

three.js R104

创建纯翻译矩阵。将覆盖所有现有的矩阵元素。因此,该方法不打算将转换应用于现有变换矩阵

工作原理不同,因为它将给定矩阵与对象的局部变换矩阵相乘。这将导致给定转换和现有转换的结合

three.js R104