Maybe I am having the same issue from here
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 :
- 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.
- press a+space for a while will rotate on y, you will notice that all cubes moves not only the y one as expected.
- press z+space for a while will show something that I really dont get it