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
1 Posts 1 Posters 27 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.
  • 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

    • Login

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