Answers for "quaternion.eulerAngles 1:1 angle conversion"
http://answers.unity.com/questions/1440039/quaternioneulerangles-11-angle-conversion.html
The latest answers for the question "quaternion.eulerAngles 1:1 angle conversion"Answer by troien
http://answers.unity.com/answers/1440079/view.html
Simply put, you can't. EulerAngles are not Quaternions. You can convert between the 2. But a lot of values (if not all) can be represented in more then one way in eulerangles. For instance, set the Eulerangles of any object in the scene (using the inspector) to (90,-90,180). another one to (90,90,0). And yet another one to (90, 45, -45). Add this script to each object you set these eulerangles to.
public class Example : MonoBehaviour
{
private void Awake()
{
Debug.Log(transform.rotation.eulerAngles);
}
}
Hit play and you'll notice this is the exact same rotation... So the Quaternion has no knowledge on which one it should choose when converting this rotation to eulerangles. It picks the one that makes most sense (Don't know the exact reason of why it picks certain options over the other)
You could compare it with converting hsv to rgb. If 'value' is 0, rgb is going to be black, no matter what you set the hue or saturation (you can check this in any colorpicker with hsv in it), the resulting rgb is always black. So if you convert rgb black to hsv. Which hue or saturation should it pick if it doesn't know the original input? In this example, it would pick 0 for both hue and saturation because that is the most logical one to pick in **most** cases when you didn't convert it from hsv to rgb first.
A quaternion doesn't know the original input in euler angles. And even if it did know the last input, not only would this hit performance, it would also encounter the same problem if you would rotate a quaternion by anything else then eulerangles, what eulerangles representation should it pick then? You might be able to calculate this if you have store the original eulerangles, but I don't have enough knowledge about quaternions to help you with that...
If you want to work with eulerangles, work with eulerangles, convert to quaternion if you need to set an objects rotation. But don't convert it back. Keep your own eulerangles and use those for your calculations if you need to use eulerangles for your calculations.Thu, 07 Dec 2017 19:45:02 GMTtroien