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. QOrbitCameraController not working as expected
Forum Updated to NodeBB v4.3 + New Features

QOrbitCameraController not working as expected

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 847 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.
  • LeDrullL Offline
    LeDrullL Offline
    LeDrull
    wrote on last edited by
    #1

    Hello!

    I am porting an OpenSceneGraph application to Qt3D (Qt 5.9.2). Everything works fine so far, but there is a problem regarding QOrbitCameraController: when I use the RMB to pan the view, the camera doesn't rotate about the vertical axis as expected.

    I found the problem looking into the source code of the QOrbitCameraController class: the up vector is hardcoded to (0, 1, 0). Since my setup uses Z as the vertical axis, I had to set the camera up vector to (0, 0, 1), so the rotation is performed about the wrong axis.

    I think that setting the controller to use the up vector from the camera would make more sense. It behaves as expected if I modify the QOrbitCameraController class code, by passing m_camera->upVector() to panAboutViewCenter(), instead of m_cameraUp. However, this is not an optimal solution, since it requires to recompile Qt.

    It would be nice to have a camera controller similar to OSG's "TrackballManipulator". Will it be possible to achieve a similar behavior with the upcoming QAbstractCameraController class that's being introduced in Qt 5.10?

    m.sueM 1 Reply Last reply
    0
    • LeDrullL LeDrull

      Hello!

      I am porting an OpenSceneGraph application to Qt3D (Qt 5.9.2). Everything works fine so far, but there is a problem regarding QOrbitCameraController: when I use the RMB to pan the view, the camera doesn't rotate about the vertical axis as expected.

      I found the problem looking into the source code of the QOrbitCameraController class: the up vector is hardcoded to (0, 1, 0). Since my setup uses Z as the vertical axis, I had to set the camera up vector to (0, 0, 1), so the rotation is performed about the wrong axis.

      I think that setting the controller to use the up vector from the camera would make more sense. It behaves as expected if I modify the QOrbitCameraController class code, by passing m_camera->upVector() to panAboutViewCenter(), instead of m_cameraUp. However, this is not an optimal solution, since it requires to recompile Qt.

      It would be nice to have a camera controller similar to OSG's "TrackballManipulator". Will it be possible to achieve a similar behavior with the upcoming QAbstractCameraController class that's being introduced in Qt 5.10?

      m.sueM Offline
      m.sueM Offline
      m.sue
      wrote on last edited by
      #2

      Hi @LeDrull

      5.10 is already in beta phase. No chance for such changes there.

      You should propose and discuss such changes on the Qt Interest mailing list anyway: http://lists.qt-project.org/mailman/listinfo

      -Michael.

      1 Reply Last reply
      1

      • Login

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