我使用示例在屏幕上获得了任意实体 QMesh。这很棒。但我对此无能为力。 mesh->children().count = 0, mesh->primitiveCount=0, mesh->geometry()=0 等等。如何获取QMesh的内部内容?我可以通过编程方式即时更改 QMesh 顶点(几何)吗? “setSource()”似乎并不适用于所有场合。
最佳答案
Qt3DCore::QEntity * meshEntity = new Qt3DCore::QEntity( rootEntity );
Qt3DRender::QMesh * mesh = new Qt3DRender::QMesh();
QUrl url;
url.setScheme("file");
url.setPath("/tmp/trefoil.obj");
mesh->setSource( url );
// now i print some of properties.
qDebug() << mesh->geometry() << ", children nodes=" << mesh->childrenNodes().count();
// ... children... primitiveCount... and so on. I see only empty values.
关于c++ - 如何获取和操作 QMesh 的顶点、面等等?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38684414/