[Interest] Adding new 3D geometry support to Qt3D?

Paul Lemire paul.lemire at kdab.com
Mon Jul 8 09:00:23 CEST 2019


Hi Nicholas,

There are basically 3 ways of handling additional geometry formats in Qt3D.

* The first approach is through the use of sceneloaders plugins
https://code.qt.io/cgit/qt/qt3d.git/tree/src/plugins/sceneparsers?h=dev

SceneLoader plugins basically have to convert a scene format into a Qt3D
subtree composed of QEntity/QGeometryRenders/QMaterials ....  If you
want to use your own custom materials, you'd have to traverse the tree
once loaded and replace the materials by the ones you want to use or
write your own sceneparser plugin.

This is what's used by the glTF loader and the assimp loader (which
handles all format the Assimp library supports). Please note that the
glTF 2.0 loader is far from being fully glTF2 compliant. There is a
fully compliant glTF2 importer for  Qt3D as part of the Kuesa project.

* The second approach is to create your own
Qt3DRender::QGeometryRender/QGeometry loader, independent of any Qt3D
plugin system. You basically have to create your own wrapper that
instantiates the correct QAttributes/QBuffers to make up a valid
QGeometry (essentially doing something similar to
https://code.qt.io/cgit/qt/qt3d.git/tree/tests/manual/custom-mesh-cpp/main.cpp?h=dev).
Please note that with this approach, you only focus on the geometry, you
can then use any Qt3D material to render it.

* The third approach is kind of a hybrid between the two approaches,
creating a geometryloader plugin
(https://code.qt.io/cgit/qt/qt3d.git/tree/src/plugins/geometryloaders?h=dev)

When using the QMesh object (subclass of QGeometryRenderer), it uses the
most relevant plugin to load a given mesh file. Note that we are talking
about mesh level file formats (.obj) and not a scene file format (.gltf,
collada ...).
https://code.qt.io/cgit/qt/qt3d.git/tree/src/plugins/geometryloaders?h=dev

Again this approaches only focuses on the geometry part.

I hope that helps,

Paul


On 7/6/19 7:40 AM, Nicholas Yue wrote:
> Hi,
>
>   I read that Qt 5.13 will have glTF 2.0 support.
>
>   I am interested to add a couple of additional geometry format to Qt.
>
>   Where can I find out more about the design behind the general
> support for 3D geometry formats e.g. OBJ, glTF, DAE etc.
>
>   I am hoping to develop something I need (Alembic) that follows Qt3D
> best practices so that I can concentrate on the geometry and leverage
> the other aspect like material/shading that is already part of Qt3D
>
> Cheers
> -- 
> Nicholas Yue
> Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5
> Custom Dev - C++ porting, OSX, Linux, Windows
> http://au.linkedin.com/in/nicholasyue
> https://vimeo.com/channels/naiadtools
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> https://lists.qt-project.org/listinfo/interest

-- 
Paul Lemire | paul.lemire at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel: France +33 (0)4 90 84 08 53, http://www.kdab.fr
KDAB - The Qt, C++ and OpenGL Experts

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190708/caab5ad4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4282 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20190708/caab5ad4/attachment.bin>


More information about the Interest mailing list