[Interest] Qt3DCore::QTransform::fromAxisAndAngle
Igor Mironchik
igor.mironchik at gmail.com
Thu Apr 6 10:28:41 CEST 2017
Hi,
06.04.2017 7:13, Igor Mironchik пишет:
> Hello,
>
> What does Qt3DCore::QTransform::fromAxisAndAngle units of angle
> expect? Degs or rads?
It uses degrees...
405
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#_ZN11QQuaternion16fromAxisAndAngleERK9QVector3Df>
QQuaternion
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.h.html#QQuaternion>
QQuaternion
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.h.html#QQuaternion>::fromAxisAndAngle(/const/
QVector3D
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qvector3d.h.html#QVector3D>&
axis, /float/ angle)
406
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#406>
{
407
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#407>
/// Algorithm from:/
408
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#408>
/// http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q56/
409
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#409>
/// We normalize the result just in case the values are close/
410
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#410>
/// to zero, as suggested in the above FAQ./
411
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#411>
/float/ a = (angle
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#5angle>
/ 2.0f) * M_PI <https://code.woboq.org/qt5/include/math.h.html#418> /
180.0f;
412
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#412>
/float/ s = std::sin
<https://code.woboq.org/qt5/include/c++/6.1.1/cmath.html#_ZSt3sinf>(a
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#6a>);
413
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#413>
/float/ c = std::cos
<https://code.woboq.org/qt5/include/c++/6.1.1/cmath.html#_ZSt3cosf>(a
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#6a>);
414 QVector3D
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qvector3d.h.html#QVector3D>
ax = axis
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#4axis>.normalized
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qvector3d.h.html#_ZNK9QVector3D10normalizedEv>();
415 *return* QQuaternion
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.h.html#QQuaternion>(
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.h.html#_ZN11QQuaternionC1Effff>c
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#8c>,
ax
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#9ax>.x
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qvector3d.h.html#_ZNK9QVector3D1xEv>()
* s
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#7s>,
ax
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#9ax>.y
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qvector3d.h.html#_ZNK9QVector3D1yEv>()
* s
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#7s>,
ax
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#9ax>.z
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qvector3d.h.html#_ZNK9QVector3D1zEv>()
* s
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#7s>).normalized
<https://code.woboq.org/qt5/qtbase/src/gui/math3d/qquaternion.cpp.html#_ZNK11QQuaternion10normalizedEv>();
416 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170406/88dd55a4/attachment.html>
More information about the Interest
mailing list