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. Load 3D model with Qt3D (Qt5.5)
Forum Updated to NodeBB v4.3 + New Features

Load 3D model with Qt3D (Qt5.5)

Scheduled Pinned Locked Moved General and Desktop
11 Posts 4 Posters 22.8k Views 3 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.
  • A Offline
    A Offline
    avmg
    wrote on last edited by
    #1

    Hi everybody

    As the new Qt5.5 version is ready with some changes in Qt3D module, i'm trying to load a 3D model (i don't care the format: 3ds, obj, js ...) and rotate it. I already found many info about it like Assimp or GLC_LIB but i was wondering if with the new Qt3D release in Qt5.5 there is some easy way to do it, as this part of my application is really simple and i'm new on these concepts about QML, OpenGL, etc...

    I already read many info about this and i'm a bit collapsed, so basically now i'm searching for a simple example to load a model and play with it.

    Thanks in advance,
    Amg

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      You should take a look at the Qt3D Examples page. Object loading is done in e.g. assimp Example.

      A 1 Reply Last reply
      0
      • Chris KawaC Chris Kawa

        You should take a look at the Qt3D Examples page. Object loading is done in e.g. assimp Example.

        A Offline
        A Offline
        avmg
        wrote on last edited by avmg
        #3

        @Chris-Kawa Thanks for reply, i tried to open that example that comes when installing the Qt5.5 but i get this error when executing:

        error: cannot find -lQt53D

        The others examples work but they are not for loading models. Is it possible to open a model with assimp without using QML? Or, How can i insert qml into a qwidget in Qt5.5? I found:

        #include <QDeclarativeView>

        ...but looks like was for Qt4.8 version, I tried with QQuickView from Qt5.5 without success...

        P 1 Reply Last reply
        0
        • A Offline
          A Offline
          avmg
          wrote on last edited by
          #4

          Finaly i could add a js model (qml) to a widget. To do it i created a widget container and i inserted my QQuickView object on it. After i have to find out the way to export my own 3D model into a Three.js format.

          But i'm still interested on the OpenGL Widget and on how to load a 3ds model with Assimp, for the moment i couldn't fix the error: "cannot find -lQt35D"

          If someone has an idea or suggestion would be great!
          Thanks!

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi,

            Do you have that error from building one of the example ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            A 1 Reply Last reply
            0
            • SGaistS SGaist

              Hi,

              Do you have that error from building one of the example ?

              A Offline
              A Offline
              avmg
              wrote on last edited by
              #6

              @SGaist Yes, all the examples i've tested worked fine except this, the Assimp example.

              A 1 Reply Last reply
              0
              • A avmg

                @SGaist Yes, all the examples i've tested worked fine except this, the Assimp example.

                A Offline
                A Offline
                avmg
                wrote on last edited by
                #7

                @avmg Any suggestion about this error? I cannot find the libQt53D.so library on my computer...

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  How did you install Qt 5.5 ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    avmg
                    wrote on last edited by
                    #9

                    I just downloaded the Qt5.5 version from:

                    http://download.qt.io/official_releases/qt/5.5/5.5.0/qt-opensource-linux-x64-5.5.0-2.run

                    ...I executed the run file and that's it. But i realised that i cannot run the Qt3d examples, in most of them i get the same error and now i'm wondering if i need to install something else, I though not because Qt3D comes inside the Qt5.5 release, Isn't it?

                    1 Reply Last reply
                    0
                    • A avmg

                      @Chris-Kawa Thanks for reply, i tried to open that example that comes when installing the Qt5.5 but i get this error when executing:

                      error: cannot find -lQt53D

                      The others examples work but they are not for loading models. Is it possible to open a model with assimp without using QML? Or, How can i insert qml into a qwidget in Qt5.5? I found:

                      #include <QDeclarativeView>

                      ...but looks like was for Qt4.8 version, I tried with QQuickView from Qt5.5 without success...

                      P Offline
                      P Offline
                      PierreChicoine
                      wrote on last edited by
                      #10

                      @avmg The problem with the Assimp.cpp example is that it uses the setSource in QAbstractSceneLoader class which only allows one object to be loaded into the scene. When it's followed with another setSource it destroys the original object. This makes it unusable as is. QML does it with the Assimp example so it should be able to be done in C++. Question is, how?

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        PierreChicoine
                        wrote on last edited by
                        #11

                        Found it.

                        in the materials sample they use m_plant->mesh()->setSource(QUrl(QStringLiteral("qrc:/assets/houseplants/") + potNames[m_potShape] + QStringLiteral("-") + plantNames[m_plantType] + QStringLiteral(".obj")));.

                        This effectively load multiple 3d objects so they can be manipulated by Qt3D. The world of Qt3D is right again.

                        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