Some questions about rotate.
Instructions in advance , my unity version is 5.4.1f1,and I am a Chinese that my English is poor,I hope you can have the patience to read this passage ,thanks. In my project ,I want to rotating a gameobject ,but I found some things that I can't understand: When I change a gameobject's rotation in inspector of the gameobject ,I found if the initial size is (0,0,0), I change any axis ,the gameobject is rotating according to the axis accurately and I can find it in Scene. But if the initial size is (20,0,0),I change Z,gameobject can rotating according to the axis that now gameboject's axis in the Scene, but if I change Y,the rotate's according isn't now gameobject's axis. in the Scene,I observed at the gameobject is rotating according to the (0,0,0)'s axis. Why I change the Z ,gameobject is all rotating according to itself,but I change Y,gameobject is rotating according to the other one coordinate system? It isn't the world coordinate system,I try to implementation in c#,whether I use Space.Self or Space.World,the question is appear. Who can give me some hints?Thanks,I feel sorry for my language proficiency.
Answer by 5c4r3cr0w · Jan 11, 2017 at 01:47 PM
It happens because Gimble Lock .. Here when you rotate GameObject to 20 degrees Z axis loses the "Degree of Freedom". So One will rotate Globally and Other will rotate locally. When your X is set to 90 or 270 degrees Y axis and Z axis will do same rotation. You should always rotate with respect to world space though.
Here is another useful and more detailed answer you may find helpful
Thank you very much for the answer. But I didn't find the Gimble Lock or Degree of Freedom,where can I set it in u3d? If it's convenient for you,give me some webpage or demo please.And I hope the gameobject rotate with respect to itself, it‘’s easier to calculate relative to the world space. $$anonymous$$aybe Quaternion.AngleAxis able to solve my problem?
Here is Detailed video about it . You might get some idea.
https://www.youtube.com/watch?v=zc8b2Jo7mno
And yes using Quaternion.AngleAxis or Quaternion.RotateAround method would solve this problem.
I will carefully watch the video,Thanks a million.