Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-58987

Unable to perform relative rotation on nested meshes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P1: Critical
    • None
    • 5.8.0
    • Qt3D
    • 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.

      Attachments

        1. ForwardSpot.tar.gz
          11 kB
        2. no_transform_OK.png
          no_transform_OK.png
          22 kB
        3. pan_transform_deformation.png
          pan_transform_deformation.png
          38 kB
        4. tilt_tranform_deformation.png
          tilt_tranform_deformation.png
          23 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            whagen Wieland Hagen
            mcallegari79 Massimo Callegari
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes