How to X rotate object using other object as reference?

Maybe I am having the same issue from here :smile:

I did notice that:
Getting the x angle allways works as intend using this method.
Getting the y angle works, but get in the matrix dirt from x rotation and z rotation.
Getting the z angle dont work at all, it seens to get dirt, and also rotate only to 180º , then invert the diretion somehow.

I was planning to make a video, if someone that understand rotation and is willing to help, I could post this video ilustrating this, but you can also test this code and :

  1. presss q+space for a while will rotate on x, cube x get the x rotation allways, other cubes stays in the same position as expected.
  2. press a+space for a while will rotate on y, you will notice that all cubes moves not only the y one as expected.
  3. press z+space for a while will show something that I really dont get it :stuck_out_tongue: