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. QQuaternion convert euler angle to quaternion not work
Forum Updated to NodeBB v4.3 + New Features

QQuaternion convert euler angle to quaternion not work

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 333 Views 1 Watching
  • 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.
  • W Offline
    W Offline
    WuYaZi
    wrote on last edited by
    #1

    below is my code:

    QQuaternion quat;
    quat.fromEulerAngles(0, 0, thea);
    
    
    orix = quat.toVector4D().x();
    oriy = quat.toVector4D().y();
    oriz = quat.toVector4D().z();
    oriw = quat.toVector4D().w();
    

    every time when i change thea , orix-oriw never changes, i wonder weather this is a bug? my qt version is 5.15.2.
    and when i test my data on https://quaternions.online/,it has no problem.
    捕获.JPG 2.JPG

    SGaistS 1 Reply Last reply
    0
    • W WuYaZi

      below is my code:

      QQuaternion quat;
      quat.fromEulerAngles(0, 0, thea);
      
      
      orix = quat.toVector4D().x();
      oriy = quat.toVector4D().y();
      oriz = quat.toVector4D().z();
      oriw = quat.toVector4D().w();
      

      every time when i change thea , orix-oriw never changes, i wonder weather this is a bug? my qt version is 5.15.2.
      and when i test my data on https://quaternions.online/,it has no problem.
      捕获.JPG 2.JPG

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      @WuYaZi said in QQuaternion convert euler angle to quaternion not work:

      QQuaternion quat;
      quat.fromEulerAngles(0, 0, thea);

      There's no bug. You're not using the method correctly. It's a static method.

      QQuaternion quat = QQuaternion::fromEulerAngles(0, 0, thea);
      

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

      W 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        @WuYaZi said in QQuaternion convert euler angle to quaternion not work:

        QQuaternion quat;
        quat.fromEulerAngles(0, 0, thea);

        There's no bug. You're not using the method correctly. It's a static method.

        QQuaternion quat = QQuaternion::fromEulerAngles(0, 0, thea);
        
        W Offline
        W Offline
        WuYaZi
        wrote on last edited by
        #3

        @SGaist
        thks, i mixed qquaternion with eigen library.

        1 Reply Last reply
        0
        • W WuYaZi has marked this topic as solved on

        • Login

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