带有QML的FbxGeometryLoader [英] FbxGeometryLoader with QML
问题描述
我想将.fbx文件导入我的 Scene3D ,通过 QMesh 类型,全部使用QML.根据文档
I want to import a .fbx file into my Scene3D, via the QMesh type, all in QML. Per the documentation,
如果已安装SDK,并且已构建并找到fbx几何图形加载器插件,QMesh也将支持以下格式
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).
我认为我唯一缺少的就是为fbx构建几何图形加载器,我在源文件(Qt/5.11.1/Src/qt3d/src/plugins/geometryloaders/fbx)中找到了它.
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).
我的问题: 如何从源代码构建fbx geomerty加载程序,并将其包含到我的项目中?
My question: How do I build the fbx geomerty loader from source, and include it into my project?
推荐答案
我了解到QSceneLoader
支持FBX加载,并且能够使用setSource
函数加载我的FBX文件,因此我将使用该类而不是使用QMesh
.这是QSceneLoader
文档的链接:
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
这篇关于带有QML的FbxGeometryLoader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!