Details
-
Bug
-
Resolution: Cannot Reproduce
-
P1: Critical
-
None
-
5.8.0
-
None
-
Ubuntu 16.04 64bit, nVidia GTX 960M
Description
After 3 days of struggling, I don't understand if this is just me or if I found a bug in Qt3D.
The goal: I need to be able to perform rotations on named sub-meshes at runtime.
I created a mesh where the "arm" mesh is child of "base" and where "head" is child of "arm".
In this way I can translate/rotate "base" around and the whole thing will move, as well as rotate "arm" and "head".
Unfortunately, submeshes vertices get distorted when performing a rotation, especially the "head" mesh.
At first I tried with some bindings to rotationZ and rotationX and then I moved on a Matrix4x4 transformation, like the assimp example does.
It seems that the original info are correct, but it is impossible to re-create the original matrix at runtime.
For the "head" mesh I get:
origMatrix = QMatrix4x4(0.625, 0, 0, 0, 0, 1.33333, 0, 0, 0, 0, 1, 0.71037, 0, 0, 0, 1) origTranslation = QVector3D(0, 0, 0.71037) origRotation = QQuaternion(1, 0, 0, 0) origScale = 0.625
And when I perform a new matrix rotate/translate/scale sequence I get:
Modified matrix = QMatrix4x4(0.625, 0, 0, 0, 0, 0.625, 0, 0, 0, 0, 0.625, 0.71037, 0, 0, 0, 1)
Even applying a quaternion(1, 0, 0, 0) doesn't produce the original matrix.
Please see attached self-contained example.
What am I doing wrong ?
Ideally I would just like to bind rotationZ on "arm" and rotationX on "head" and Qt3D should do the rest.