5

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:

Any suggestion?

László Papp
  • 51,870
  • 39
  • 111
  • 135
Mikael
  • 183
  • 3
  • 4
  • 11
  • How is Assimp's ["portable, ISO-compliant C++"](http://assimp.sourceforge.net/main_features.html) not cross-platform? And it claims to support `.3ds` right on the [supported formats page](http://assimp.sourceforge.net/main_features_formats.html). – genpfault Apr 16 '14 at 19:12
  • I just asked a question on about this on the QT forums http://qt-project.org/forums/viewthread/41548/ - it seems that most of the development and information Qt3D is from 2012. I imagine that it might be in the process being abandoned in favor of glwidget. Assimp should be cross platform btw. However, it is big. – MrSynAckSter Apr 16 '14 at 20:16
  • @baordog: it is far from abandoned. The design has been reworked in the background. – László Papp Apr 17 '14 at 03:01
  • Qt3D is far from being abandoned and is being almost completely rewritten for Qt3D 2.0 which is aimed to be released as part of Qt 5.5. Still, I was able to load a .dae model with the current Qt3D 1.0, with textures, on both Linux and Android with QtQuick3D and experienced no problems whatsoever. – Ayberk Özgür Oct 26 '14 at 17:56

2 Answers2

4

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.

Nejat
  • 31,784
  • 12
  • 106
  • 138
  • The OP wrote he did not find a way to use Qt3D and needed a non-qt3d solution, and you write to use Qt3D. In addition, what you link is an ancient and unmaintained version of Qt3D. It has been basically reworked, and application starting to use this would need soon a full rewrite. – László Papp Apr 18 '14 at 04:34
  • @LaszloPapp This question is not about how to use these tools. Also he did not say he needs a "non-qt3d solution". He also needs to use QGLWidget. Any way Qt3D is the most appropriate solution which can be integrated in Qt easily. – Nejat Apr 18 '14 at 09:40
  • Qt3D did not work for the OP as far as I can read. Even if you make it work, it is not a good idea IMHO because Qt3D has been abandoned for a couple of years now. I know, because I was trying to work on it, sending patches, and my contribution has been pending for 1-2 years. It has been rewritten by KDAB, but the new architecture, and API for that matter, will be entirely different, hence it will not be a simple hop for existing applications. It got unmaintained when the Brisbane office was closed by Nokia. I think it is not the best to suggest it, at least without a clear warning. – László Papp Apr 18 '14 at 09:43
2

Assimp is written in C++ and used cross-platform in several projects including the Qt Project itself.

The .3ds format seems to be supported eventually unless you use a very old version where it was not added. See the documentation for further details about it:

Common interchange formats

Note the following entry at the top:

  • 3ds Max 3DS ( .3ds )
László Papp
  • 51,870
  • 39
  • 111
  • 135