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. Best option for 3D Viewer in Qt 5.0
Forum Updated to NodeBB v4.3 + New Features

Best option for 3D Viewer in Qt 5.0

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 2 Posters 3.0k 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.
  • M Offline
    M Offline
    modeldancecontroller
    wrote on last edited by
    #1

    I am writing an application that will let users pick stuff from a scrollable list of objects(represented as icons in the list). Then drop them to a 3D Viewer. Then the user clicks ‘Play’ and these objects move.

    Its for a physics simulation where the objects to be added are in the list. So the interface is quite simple and I wanted to create it in QML. The simulation classes are in C++ (Bullet Physics). I am planning to make a 3D Viewer where the objects can be seen moving(following the laws of physics), as a QML Extension Plugin implemented in C++.

    The interface is this:!http://s29.postimg.org/xk5owzohz/frame.png(Interface)!

    The middle light gray area is where the 3D viewer will come in. The scene will be quite simple for now with max 15 to 20 objects scattered about.

    I would like to know the best way to do this. Here are the options I have found so far:

    1. Write a QQuickFramebufferObject based class: http://qt-project.org/doc/qt-5/qquickframebufferobject.html#details
      This provides a FBO already and I have to implement the renderer in a QQuickFramebufferObject ::Renderer class: http://qt-project.org/doc/qt-5/qtquick-scenegraph-textureinsgnode-example.html

    2. Extend QQuickItem http://qt-project.org/doc/qt-5.0/qtquick/scenegraph-openglunderqml.html
      But this means I have to deal with Qt's scene graph and also create a FBO for some reason. I am not sure if this will result in my rendering going into the correct area of the window(gray area)

    3. Extend from QQuickPaintedItem and implement paint()

    4. Extend QDeclarativeItem which seems to be deprecated.

    I would like to keep the drawing efficient and as fast as possible.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      modeldancecontroller
      wrote on last edited by
      #2

      So there is a full featured example under : Qt5.2.1\5.2.1\msvc2012\examples\quick\scenegraph\textureinsgnode

      It shows how to use the QQuickFramebufferObject and create a renderer etc. Studying it now.

      Qt is absolutely awesome !!!!!

      1 Reply Last reply
      0
      • O Offline
        O Offline
        onek24
        wrote on last edited by
        #3

        Please keep us/this thread updated!

        1 Reply Last reply
        0
        • M Offline
          M Offline
          modeldancecontroller
          wrote on last edited by
          #4

          Well I shoved in the 3D viewer(which I call a simviewer) now :

          !http://s2.postimg.org/hl6zgn03t/frame.png(Sim Viewer)!

          Code here:
          https://code.google.com/p/rapid-concepts/source/browse/#svn/trunk

          Based it on : \Qt\Qt5.2.1\5.2.1\msvc2012\examples\quick\scenegraph\textureinsgnode

          After adding the new C++ files, I got a linking error. It seems the files do get added to the project .pro file correctly, but qmake is not run automatically. So ran it and everything is good now :)

          Also the new type has to be registered in main as a new qml meta type.

          Qt is awesome !

          1 Reply Last reply
          0
          • O Offline
            O Offline
            onek24
            wrote on last edited by
            #5

            Great work! I'll check it out later. :)

            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