使用示例,我在屏幕上得到了任意坚实的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/

10-10 10:00