This question was
closed Mar 11, 2020 at 09:29 PM by
streeetwalker for the following reason:
The question is answered, right answer was accepted
Question by
streeetwalker · Mar 11, 2020 at 09:02 PM ·
quaternionangleangleaxis
the reverse operation of Quaternion.AngleAxis?
Hey, I'm having fun with Quaternions! (Kind of like when you go to the dentist to have a tooth pulled...)
I can create a Quaternion given an angle and an axis, for example:
Quaternion q = Quaternion.AngleAxis( 90f, Vector3.forward );
Now, how can I do the reverse: given a Quaternion and Vector3.forward, get an angle back?
Is it possible?
Comment
Answer by streeetwalker · Mar 11, 2020 at 09:29 PM
I figured it out. Since I am only doing rotation on the Vector3.forward axis, Quaternion.eulerAngles gives me angle on that axis - the other axes are zero.