2016-07-31 49 views
2

我使用示例在屏幕上獲得了任意固體QMesh。這很棒。但我無能爲力。 mesh-> children()。count = 0,mesh-> primitiveCount = 0,mesh-> geometry()= 0等等。如何獲取QMesh的內部內容?我可以通過編程方式更改QMesh頂點(幾何圖形)嗎? 「setSource()」似乎不適合所有場合。如何獲取和操作QMesh頂點,面,其他東西?

+0

您能否提供一些代碼示例,以便我們能夠更好地看到您正在嘗試完成的任務? – MichaelDotKnox

回答

0
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. 
+0

我想知道類似於mesh-> getVertices(),mesh-> getBones(),getFacets()...等等。網格內任何形式的幾何形體描述(實體)。 – UncleSal

+0

我正在尋找同樣的事情。你設法做到了嗎? – SteveTJS

+0

不幸的是沒有。取而代之的是,我使用了assimp庫和基於QOpenGLWindow的可視化。 – UncleSal