1
將矩陣應用到網格後,我打印其旋轉參數。 重置網格旋轉後,縮放和位置並重新應用相同的矩陣 - 旋轉參數不等於先前的參數。Three.js:applyMatrix後的混沌網格旋轉
var ctm1 = new THREE.Matrix4();
var ctm2 = new THREE.Matrix4();
ctm1.set(...............);
ctm2.set(...............);
function reset(mesh)
{
mesh.position.set(0,0,0);
mesh.scale.set(5,5,5);
mesh.rotation.set(0,0,0);
}
reset(myMesh);
myMesh.applyMatrix(ctm1);
console.log(myMesh.rotation.x);
reset(myMesh);
myMesh.applyMatrix(ctm2);
reset(myMesh);
myMesh.applyMatrix(ctm1);
console.log(myMesh.rotation.x); //Isn't equal to previous output !!!
three.js所r.58
您研究過'Object3D.applyMatrix()'的源代碼嗎? – WestLangley
不,看來我必須。 – Paul
@WestLangley:所以,你想說的是'm1'無法重置? – Paul