Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. C++ Qt3DExtras::QTorusMesh – cannot be rotated in Z direction
QtWS25 Last Chance

C++ Qt3DExtras::QTorusMesh – cannot be rotated in Z direction

Scheduled Pinned Locked Moved Solved General and Desktop
qt3d
6 Posts 3 Posters 980 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JulianM
    wrote on 10 Jan 2019, 07:35 last edited by JulianM 1 Oct 2019, 07:40
    #1

    Hello Everyone,
    It could be me, but I tried to make very quickly Rotation Gizmo in C++ Qt3D – and I noticed that there is a problem with QTorusMesh – rotation in Z.
    I thought is something wrong in my fast code – but even when I tried Torus in basic shapes demo – also doesn’t work. Here is an example code

    // Torus shape data
        //! [0]
        m_torus = new Qt3DExtras::QTorusMesh();
        m_torus->setRadius(1.0f);
        m_torus->setMinorRadius(0.4f);
        m_torus->setRings(100);
        m_torus->setSlices(20);
        //! [0]
    
        // TorusMesh Transform
        //! [1]
        Qt3DCore::QTransform *torusTransform = new Qt3DCore::QTransform();
        torusTransform->setScale(2.0f);
        torusTransform->setRotation(QQuaternion::fromAxisAndAngle(QVector3D(0.0f, 1.0f, 0.0f), 90.0f));
    	torusTransform->setRotationZ(45.0f);
        torusTransform->setTranslation(QVector3D(5.0f, 4.0f, 0.0f));
    

    I added only ….. torusTransform->setRotationZ(45.0f);
    I expected this to be rotated in 90 around Y and then 45 around Z.
    So the result should be something like that / I cannot upload picture here/

      -                                          -
      -   -        in fact is only  90 deg       -     
          -                                      -
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Jan 2019, 19:01 last edited by
      #2

      Hi,

      You should also add what version of Qt you are using.
      And the platform as well.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        JulianM
        wrote on 11 Jan 2019, 08:07 last edited by
        #3

        Hi SGaist,

        Sorry about that.
        I'm using 5.12 on Windows 10.

        My concern is that this looks like there is a problem in Qt3DCore::QTransform which is core module from a long time / 5.5 or earlier/.
        I was away of Qt for the last few years but before I love it - was solid as rock - now ... there are obvious small bugs even in the demos.
        Documentation is close to nothing ... really sad.

        BTW Just to update for information - i made custom entity Circle and attached to it - Qt3DCore::QTransform and I got the same result - does't work - that's why I got suspicious in QTransform . I looked in the the code - some eigen vector comprising is "fishy" - but i went in another direction - using directly Matrices and now works- but then QTransform looks useless - and nobody to not catch it till now- means nobody use it? Probably because of the priority of QML.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          JohanSolo
          wrote on 11 Jan 2019, 08:22 last edited by
          #4

          Might it be your 45° rotation is performed around the torus symmetry axis?

          `They did not know it was impossible, so they did it.'
          -- Mark Twain

          1 Reply Last reply
          0
          • J Offline
            J Offline
            JulianM
            wrote on 11 Jan 2019, 16:34 last edited by
            #5

            @JohanSolo said in C++ Qt3DExtras::QTorusMesh – cannot be rotated in Z direction:

            torus symmetry axis

            I don't think so.
            As I mentioned I made rotation Gizmo as 3D modeling software for rotation - so I have 3 "donuts" - one facing X; one facing Y and one facing Z;
            For this one that is facing Z - it will be clear that even rotation to happen it will not be visible for the viewer in Z direction.
            That is probably your point if I can get you correctly.
            Anyway my problem were the other two / facing X and Y/ when i rotate them in Z - QTransform attached to this Entity report rotationZ - number but there is not rotation of the particular torus.
            Any rotation of a torus in Z refuse to happen.

            1 Reply Last reply
            0
            • J Offline
              J Offline
              JulianM
              wrote on 16 Jan 2019, 04:41 last edited by
              #6

              Ok I found what is causing that - the torus is created facing Z.

              Thanks.

              1 Reply Last reply
              1

              1/6

              10 Jan 2019, 07:35

              • Login

              • Login or register to search.
              1 out of 6
              • First post
                1/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved