我尝试torus
沿 2 个轴旋转 a:Ox 和 Oz。我想dat.gui
用鼠标修改的滑块应用这种旋转。
我已经定义了torus
:
var geometryTorus = new THREE.TorusGeometry( radius, 2*widthLine, 100, 100 );
var materialLine = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
torus = new THREE.Mesh( geometryTorus, materialLine );
scene.add(torus);
我的问题是旋转Ox axis
工作正常,但旋转不是这种情况Oz axis
。
我通过调用以下函数为圆环旋转:
// Change great circle parameters
function changeGreatCircle(thetax, thetaz) {
// Update rotation angles
torus.rotation.x = thetax;
torus.rotation.z = thetaz;
}
对于上述函数,我调用render('init')
计算相机位置的函数。
如何使这个圆环旋转Oz axis
?为什么它沿着Ox axis
而不是沿着旋转Oz axis
?
如果有人可以提供线索,那就好了。
谢谢
更新 1:
我找到了解决方案,因为我没有考虑到Euler angles
,即 2 次旋转(绕轴X
和Y
轴)的顺序。解决方案是设置torus.rotation.order = 'ZXY';