Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.11.2, 6.2
-
None
-
-
6ffc8d8eb6 (qt/qtbase/dev) 28d2e224a1 (qt/qtbase/6.2) 28d2e224a1 (qt/tqtc-qtbase/6.2) 6ffc8d8eb6 (qt/tqtc-qtbase/dev), e2bc6e027 (tqtc/lts-5.15), 1e5ae32c5 (tqtc/lts-5.15)
Description
In certain cases (related to gimbal lock?) I'm getting inconsistent results moving between quaternion and Euler angle representations.
E.g.:
QVector3D eulerAngles1(90.f, -90.f, 0.f); QQuaternion quaternion1 = QQuaternion::fromEulerAngles(eulerAngles1); QVector3D eulerAngles2 = quaternion1.toEulerAngles(); QQuaternion quaternion2 = QQuaternion::fromEulerAngles(eulerAngles2); qDebug() << eulerAngles1; qDebug() << quaternion1; qDebug() << eulerAngles2; qDebug() << quaternion2;
produces
QVector3D(90, -90, 0) QQuaternion(scalar:0.5, vector:(0.5, -0.5, 0.5)) QVector3D(89.972, 0, 0) QQuaternion(scalar:0.707279, vector:(0.706934, 0, 0))
And it isn't a matter of ambiguity. Those two quaternions are two totally different orientations. Is it toEulerAngles() where it goes wrong?
Also, does the following description in the documentation apply?
Creates a quaternion that corresponds to a rotation of eulerAngles: eulerAngles.z() degrees around the z axis, eulerAngles.x() degrees around the x axis, and eulerAngles.y() degrees around the y axis (in that order).
As far as I can interpret what I'm seeing, the order seems to be the opposite, y-x-z.
Attachments
Issue Links
- mentioned in
-
Page Loading...
For Gerrit Dashboard: QTBUG-72103 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
361537,4 | QtGui/math3d : Fix QQuaternion::getEulerAngles for GimbalLock cases | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
362742,4 | QtGui/math3d: Fix QQuaternion::getEulerAngles for GimbalLock cases | dev | qt/qtbase | Status: MERGED | +2 | 0 |
390238,2 | QtGui/math3d: Fix QQuaternion::getEulerAngles for GimbalLock cases | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |
390239,2 | QtGui/math3d: Fix QQuaternion::getEulerAngles for GimbalLock cases | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
390240,4 | QtGui/math3d: Fix QQuaternion::getEulerAngles for GimbalLock cases | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
406418,3 | Update comments in QQuaternion::getEulerAngles | dev | qt/qtbase | Status: MERGED | +2 | 0 |
407748,2 | Update comments in QQuaternion::getEulerAngles | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |
407750,2 | Update comments in QQuaternion::getEulerAngles | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
407751,3 | Update comments in QQuaternion::getEulerAngles | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
483564,1 | QtGui/math3d: Fix QQuaternion::getEulerAngles for GimbalLock cases | tqtc/lts-5.15-vxworks | qt/tqtc-qtbase | Status: ABANDONED | 0 | 0 |
483565,1 | Update comments in QQuaternion::getEulerAngles | tqtc/lts-5.15-vxworks | qt/tqtc-qtbase | Status: ABANDONED | 0 | 0 |