Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Unsolved QT3D how to get the mesh from QCuboidMesh?

    General and Desktop
    1
    1
    115
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jimfar last edited by

      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

      1 Reply Last reply Reply Quote 0
      • First post
        Last post