Quantcast
Channel: Answers by "gfoot"
Viewing all articles
Browse latest Browse all 95

Answer by gfoot

$
0
0
That is expected, the translation from Euler angles to Quaternion and back is not lossless - rounding errors cause slight variation of the results, and also the Euler angles are normalized into a specific set of ranges which can lead to sharp changes in value (e.g. 360 => 0). You can either add some leeway to your "if", or test like this instead: if (targetRotation == angle) { ... } which should work for your case. It would not necessarily work, though, for Y axis rotations, nor for certain key angles about any axis, due to the sharp jumps in Euler angle values at those points.

Viewing all articles
Browse latest Browse all 95

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>