2016-06-28 193 views

回答

0

我建议看看https://doc-snapshots.qt.io/qt5-5.9/qt3d-basicshapes-cpp-example.html,前一段时间我问自己一个类似的问题,即如何绘制一个圆圈。那么,在3D一圆是有它的半径的特殊比例圆环:

// thin Torus = Circle in 3D 
Qt3DCore::QEntity *torusEntity0 = new Qt3DCore::QEntity(rootEntity); 
Qt3DExtras::QTorusMesh *torusMesh0 = new Qt3DExtras::QTorusMesh; 
torusMesh0->setRadius(15); 
torusMesh0->setMinorRadius(0.01f); 
torusMesh0->setRings(100); 
torusMesh0->setSlices(20); 
torusEntity0->addComponent(torusMesh0); 
torusEntity0->addComponent(material); 

那么,什么将是3D一条线吗?这将是一个外径非常小的圆柱体。