How to show 3D model(.obj) in a QOpenGLWidget
-
wrote on 27 Mar 2018, 14:58 last edited by
-
Hi and welcome to devnet,
What about using Qt3D ?
-
wrote on 28 Mar 2018, 00:54 last edited byThis post is deleted!
-
wrote on 28 Mar 2018, 01:13 last edited by
@SGaist Oh, sorry, I previously mistakenly believe that QOpenGLWidget belongs to Qt:3D module。
Now I have already seen 3 examples:
qt3d-basicshapes-cpp-example
qt3d-materials-cpp-example
qt3d-simple-cpp-example- Is like this to embedded 3D windows to app ?,Is this the only way?:
Qt3DExtras::Qt3DWindow view; // Scene Root Qt3DCore::QEntity *sceneRoot = new Qt3DCore::QEntity(); ... RenderableEntity *chest = new RenderableEntity(sceneRoot); chest->transform()->setScale(0.03f); // load obj file chest->mesh()->setSource(QUrl(QStringLiteral("qrc:/assets/chest/Chest.obj"))); ... view.setRootEntity(sceneRoot); view.show();
- And if i use Qt:3D ,how can i control a 3D model(*.obj) using a QTimer,because I need to use a timer to control the gesture of the 3D model in my project,including mouse event, key event and repaint, resize etc.
how to do control it using Qt:3D,is there a reference example?
-
You should start here. You can find there amongst other things the Input and Animation module that will likely contain what you are looking for.
-
You should start here. You can find there amongst other things the Input and Animation module that will likely contain what you are looking for.
wrote on 29 Mar 2018, 01:00 last edited by@SGaist ok,Thank you.
1/6