旋转是否可能以世界而不是物体的轴为轴心?
我需要对某个对象进行一些旋转,但是在第一次旋转之后,我无法像我想要的那样进行其他旋转。
如果无法在世界的轴上旋转,我的第二个选择是在第一次旋转后重置轴。有一些功能吗?
我不能使用object.eulerOrder
,因为当我旋转一些设置object.eulerOrder="YZX"
后,它会改变对象的方向。
最佳答案
三-r107
// select the Z world axis
this.myAxis = new Vector3(0, 0, 1);
// rotate the mesh 45 on this axis
this.mesh.rotateOnWorldAxis(this.myAxis, Math.degToRad(45));
animate() {
// rotate our object on its Y axis,
// but notice the cube has been transformed on world axis, so it will be tilted 45deg.
this.mesh.rotation.y += 0.008;
}