Qt3d Using QSceneLoader with qt 5.8

依然范特西╮ 提交于 2019-12-01 09:28:57

I use http://code.qt.io/cgit/qt/qt3d.git/tree/tests/manual/assimp-cpp to load my own Collada robot model which works without errors. The important lines are:

// Root entity
Qt3DCore::QEntity *sceneRoot = new Qt3DCore::QEntity();
...
// Scene loader
Qt3DCore::QEntity *sceneLoaderEntity = new Qt3DCore::QEntity(sceneRoot);
Qt3DRender::QSceneLoader *sceneLoader = new Qt3DRender::QSceneLoader(sceneLoaderEntity);
SceneWalker sceneWalker(sceneLoader);
QObject::connect(sceneLoader, &Qt3DRender::QSceneLoader::statusChanged, &sceneWalker, &SceneWalker::onStatusChanged);
sceneLoaderEntity->addComponent(sceneLoader);

So try it out with your obj file.

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