Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

3D model (.3ds) in Qt OpenGL widget

I need to load a 3D model (.3ds file) in my QGLWidget (Qt OpenGL widget). I am looking for a cross-platform solution working under Linux, Windows and Mac.

I have found some solutions on the web, but still have not been able to integrate any of them work in my Qt application:

  • Assimp: it is not cross-platform and does not support .3ds models (http://assimp.sourceforge.net/)

  • Qt3D: it is cross-platform and seeems to be the right choice for OpenGL widgets. Unfortunatelly, I still have not find the way to use it. (https://github.com/qtproject/qt3d)

  • Qt Quick: it uses QML files instead of QT widgets.

  • 3ds Loader: http://www.spacesimulator.net/wiki/index.php?title=Tutorials:3ds_Loader

Any suggestion?

like image 911
Mikael Avatar asked Apr 16 '14 17:04

Mikael


1 Answers

You can use Qt3D. It adds 3D content to Qt Quick's cross-platform ability. Apps can be 2D QML applications with a small amount of simple 3D content; through to complex 3D scenes, containing 3D assets - such as complex 3D models, and shader effects.

Qt3D supports 2D and 3D rendering in both Qt/C++ and Qt Quick applications.

You can also load a model object in 3D Studio Max (3DS) format or other standard formats like obj with a perspective camera view using Qt3D.

There are some good tutorials and examples here.

like image 91
Nejat Avatar answered Sep 17 '22 20:09

Nejat