如何获取和操作QMesh顶点、面等

How to obtain and manipulate QMesh vertices, faces, something else?

本文关键字:QMesh 操作 顶点 面等 何获取 获取      更新时间:2023-10-16

我使用示例在屏幕上获得了任意的实心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.