0

i read three.js docs about rotation so i know that three.js uses intrinsic (Tait-Bryan) ordering on Euler angles when applying rotation. Then as i remember they get converted to quaternions in the backend to prevent gimbal lock.

My goal is to apply a yzy rotation.

Lets think of an angle phi.

Lets think of another angle theta.

Theta is constant an arbitirary value that i will use as a step.

In the render loop,

function render(){
   object.rotation.y = phi;
   object.rotation.z += theta;
   object.rotation.y = -phi;
}

I get confused about what happens here.

Are these the steps of a YZY Euler angle application? How rotation works in three.js internally? Thank you for help.

To be more clear, is

   object.rotation.x = val1;
   object.rotation.y = val2;
   object.rotation.z = val3;

the same as

   object.rotation.setRotationFromEuler(new THREE.Euler(val1,val2,val3,'XYZ'));

also the same as

   let vec = new THREE.Vector3(object's current normalized direction vector);
   vec.applyEuler(new THREE.Euler(val1,val2,val3,'XYZ'));

   object.rotation.x = vec.x;
   object.rotation.y = vec.y;
   object.rotation.z = vec.z;

these? Also any ideas why cant we do a YZY rotation in three.js?

Sorry if the question is not so clear, to be honest i feel unclear about all these :)

Ali Somay
  • 585
  • 8
  • 20
  • What do you expect, how it should behave, and how does it actually behave? – Brakebein Mar 07 '17 at 12:56
  • I edited the question. I expect that rotation.x or y or z after one another do the rotations in a sequence. So i can achieve a yzy rotation, then render the frame. – Ali Somay Mar 07 '17 at 13:21

0 Answers0