QT3D how to get the mesh from QCuboidMesh?



  • for (auto &a : m3dentity->components())
    {
    auto b1 = dynamic_cast< Qt3DRender::QGeometryRenderer*>(a);
    if (b1)
    {
    Qt3DExtras::QCuboidMesh b = (Qt3DExtras::QCuboidMesh)b1;
    auto c=b->geometry();
    for (auto d : c->attributes())
    {
    QString str = d->name();
    if (str == Qt3DRender::QAttribute::defaultPositionAttributeName()) {
    num = d->count();
    auto buf = d->buffer();
    buf->setAccessType(buf->ReadWrite);
    auto ba = buf->data();

    				break;
    				 
    			}
    		 }
    		 
    	}
    

    }
    but ba is valid


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.