quaterniontoeuler granularity lost close to 180 degrees

   1165   3   0
User Avatar
Member
2038 posts
Joined: Sept. 2015
Offline
I've put this in to support. Maybe they might give some feedback.

But it seems that when angles of geometry are about 0.25 degrees away from 180 degrees,

the quarterniontoeuler function fails to give any returns that are useful.

I could understand because of the possibility of floating point variances for smaller angle difference;

But this seems a bit high.

Once the angle difference gets above/below about 0.25 degrees ( I think it's actually above 0.256 ) from 180 degrees,

then meaningful results can be attained - like incremental values of 0.001

I've made a hip that this happens along any of the x,y or z axis.

Anyone with good math background in matrices/quaternions know what might be happening and should the function not be able to do better?

Attachments:
Quaterniontoeuler Granularity.hiplc (233.4 KB)

User Avatar
Member
8539 posts
Joined: July 2007
Online
looks more like an issue with dihedral() than quaterniontoeuler()
as for example
quaterniontoeuler(quaternion(radians(180.25), {0,1,0}), XFORM_XYZ);
seems to be precise
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
2038 posts
Joined: Sept. 2015
Offline
Yes indeed tamte…tried even smaller values and it works as expected.

I've modified my bug report, thanks.
User Avatar
Member
474 posts
Joined: July 2005
Offline
Hi,

for me it looks like a natural limit for floating point accuracy and this is not only a problem of quaternions. Every operation you will perform can have an effect on the accuracy. Perhaps there some techniques to improve the accuracy, but if your angle is near 180 degrees even the dot product is around -1 something like -0.999999. If your value is higher than a critical value the result will be rounded to -1 and acos will return pi (180 degree).
  • Quick Links