I try to make rotate a torus
along 2 axis : Ox and Oz. I want to apply this rotation with a slider dat.gui
modified by mouse.
I have defined the torus
by :
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);
My issue is that rotation along Ox axis
is working fine but this is not the case for rotation along Oz axis
.
I do the rotations for torus by calling the following function :
// Change great circle parameters
function changeGreatCircle(thetax, thetaz) {
// Update rotation angles
torus.rotation.x = thetax;
torus.rotation.z = thetaz;
}
For above function, I call render('init')
function in which I compute the position of camera.
How to make rotate this torus along Oz axis
? Why does it rotate along Ox axis
and not along Oz axis
?
If someone could give clues, this would be fine.
Thanks
UPDATE 1 :
I found out solution because I didn't take into account of the Euler angles
, i.e the order of the 2 rotations (around X
and Y
axis). The solution was to set torus.rotation.order = 'ZXY';