如何使用四元数围绕x轴然后围绕y轴旋转

时间:2019-04-30 02:19:24

标签: javascript three.js

我想先将对象绕其x轴旋转90度,然后再围绕其y轴旋转90度。如何在three.js中做到这一点?

我尝试过

mesh.rotation.x = Math.PI * 0.5;
mesh.rotation.y = Math.PI * 0.5;

但是它并没有按照我的意愿旋转。

1 个答案:

答案 0 :(得分:2)

我们可以这样实现,

mesh.rotateX(Math.PI * 0.5);
mesh.rotateY(Math.PI * 0.5);
相关问题