问题
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