FbxGeometryLoader with QML

房东的猫 提交于 2019-12-11 00:29:37

问题


I want to import a .fbx file into my Scene3D, via the QMesh type, all in QML. Per the documentation,

QMesh will also support the following format if the SDK is installed and the fbx geometry loader plugin is built and found

So the result I want is something like the following:

Entity {
... 
   Mesh{
   source: "qrc:/3dmodels/potato.fbx"
   }
}

After some searching, I found this post on the Qt forum, which directed me to download and include the Autodesk SDK into my project (via CMake).

I think that the only part I am lacking is to build the geometry loader for fbx, which I found in the source files (Qt/5.11.1/Src/qt3d/src/plugins/geometryloaders/fbx).

My question: How do I build the fbx geomerty loader from source, and include it into my project?


回答1:


I learned the QSceneLoader supports FBX loading and was able to load my FBX files with the setSource function, so I would use that class instead of using QMesh. Here's the link to the QSceneLoader documentation:

https://doc.qt.io/qt-5.11/qt3drender-qsceneloader.html



来源:https://stackoverflow.com/questions/53276844/fbxgeometryloader-with-qml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!