Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Need help on Quaternion.lookAt (NaN output)

Need help on Quaternion.lookAt (NaN output)

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 96 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.
  • F Offline
    F Offline
    FishBoneEK
    wrote last edited by
    #1

    https://doc.qt.io/qt-6/qml-qtquick3d-quaternion.html#lookAt-method

    For the following arguments:

    Quaternion.lookAt(
      Qt.vector3d(0.47212299704551697, -0.05714830011129379, -0.03842129930853844), 
      Qt.vector3d(0.0174984410405159, -0.1452823281288147, -0.038421452045440674), 
      Qt.vector3d(-0.9816991090774536, -0.19043900072574615, 0), 
      Qt.vector3d(0, 1, 0)
    )
    

    The output is a NaN quaternion? What's the issue here?

    My understanding is lookAt calculates the rotation of the forwardDirection vector of an obj at sourcePosition to the other obj at targetPosition, so that forward after rotation aligns to target - source, and tries to keep upDirection close to the positive Y axis. Is this correct?

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jonas Karlsson
      wrote last edited by
      #2

      After a quick glance at the Qt source code it seems like this is a bug so please feel free to report it.

      F 1 Reply Last reply
      0
      • J Jonas Karlsson

        After a quick glance at the Qt source code it seems like this is a bug so please feel free to report it.

        F Offline
        F Offline
        FishBoneEK
        wrote last edited by
        #3

        @Jonas-Karlsson Thanks for the reply!
        However I cannot file a bug report on the Bug Tracker (the "Create" button won't respond).
        It would be nice if you would report it instead of me.

        P.S. The bug in the bug tracker, pretty ironic?

        Thanks!

        1 Reply Last reply
        0

        • Login

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