Options to add a 3D view to a Qt C++ application
-
I have a Qt 5 application written in C++ for Windows and Mac. It has a various views in tabs, including a 2D floor plan. I want to add another tab with a 3D floor plan.
The 3D floor plan is going to be quite basic/cartoon-like. No need for meshes, custom shaders, lighting models etc. I just need to add various primitive shapes (cyclinders, cubes etc) programmatically to contruct the floor plan from the information that I already have. The user then needs to be able to move around the floor plan and do some simple manipulation.
I am trying to work out what my options are. It seems that I can use Qt 3D or Qt Quick 3D. Given that my requirements are basic and I don't have much experience in 3D stuff, is Qt Quick 3D the better choice? Is it possible to integrate this into an application that is currently pure C++ (no QML)?
I have a commercial (small business) license.
-
Hi,
For the second part of your question, yes you can mix them. In the absolute, every QtQuick application starts as a C++ application (unless you use a viewer).
As for your main question, where do you get your 3D data from ? Are you using a 3D model ?
-
@SGaist said in Options to add a 3D view to a Qt C++ application:
For the second part of your question, yes you can mix them. In the absolute, every QtQuick application starts as a C++ application (unless you use a viewer).
Ok, thanks.
@SGaist said in Options to add a 3D view to a Qt C++ application:
As for your main question, where do you get your 3D data from ? Are you using a 3D model ?
I have all the dimensions for the 2 floor plan, stored in XML, already in the application. So I just need need to add Z information (which can be a sensible default to start with).
-
@SGaist My floor plan are not too complex. Basically tables (of various shapes), seats and guests. Tables and chairs are standard heights, so it shouldn't be to hard (in principal) to create a 3D floor plan if you have all the data for a 2D floor plan.
-
One track I would explore is to check what would be needed to convert your xml to one of the format supported by Assimp which is used as loader for Qt3D.
-
Qt 3D is late on board for 3D rendering. Other packages have much more functions for this. Like VTK, https://www.blender.org/ etc.
if you do research and have time, it may be interesting to use Qt 3D to build your projects. Otherwise, you may want to try other packages and it is quicker. The interfaces of Qt packages always look simpler and easier for use. -
@AndyBrice Frankly, I had a lot of familiarity with OSG - it is very mature with a lot of useful functionality built in over the years and a robust user community. For example, it is trivial to add geometry with a space-ball "navigator" and selection to highlight an object.