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. Qt3D - How does a camera provide its view matrix

Qt3D - How does a camera provide its view matrix

Scheduled Pinned Locked Moved Solved General and Desktop
qt3dqt3d 2.0qt3drender
4 Posts 2 Posters 2.5k 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.
  • C Offline
    C Offline
    Conninho
    wrote on last edited by Conninho
    #1

    Hi everyone,

    I have a question on cameras in Qt3D:

    While Qt3D provides its own QCamera class, it is stated in the documentation of the QForwardRenderer class that

    Note: A camera is a QEntity that has a QCameraLens as one of its components.

    (The fact that the camera property of the QForwardRenderer is of type Qt3DCore::QEntity* backs this up.)

    So if I write a custom camera (by subclassing QEntity), what do I need to do to provide a view matrix? While the projection matrix is given by the QCameraLens, the view matrix needs to be provided by the camera entity itself somehow. Or am I misunderstanding this?

    Thanks in advance for any help!

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Conninho
      wrote on last edited by
      #2

      Ok, I toyed around a little and figured it out myself:

      A QEntity element that is used as a camera can, just like other (visible) QEntity elements, be positioned by attaching a QTransform component, and the view matrix is automatically induced by the camera entity's global transform (just like a visible QEntity's model matrix is induced by its transform).

      So the functionality of a QTransform object seems to be much more genral than its - optimistically named - Detailed description in the doc suggests:

      "Used to perform transforms on meshes"
      ;-)

      Big thanks to the Qt and KDAB team for Qt3D, which seems to be an awesome 3D module. Waiting patiently for more documentation...

      1 Reply Last reply
      0
      • m.sueM Offline
        m.sueM Offline
        m.sue
        wrote on last edited by m.sue
        #3

        Hi,
        the latest QT3D documentation, so far, is here: http://doc-snapshots.qt.io/qt5-dev/qt3d-cpp.html
        But e.g. QTransform did not change much yet.
        -Michael.

        C 1 Reply Last reply
        1
        • m.sueM m.sue

          Hi,
          the latest QT3D documentation, so far, is here: http://doc-snapshots.qt.io/qt5-dev/qt3d-cpp.html
          But e.g. QTransform did not change much yet.
          -Michael.

          C Offline
          C Offline
          Conninho
          wrote on last edited by
          #4

          @m.sue That's good to know, thanks for the link!

          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