Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How do I create a triangle mesh in Qt 3D using C++?
Forum Updated to NodeBB v4.3 + New Features

How do I create a triangle mesh in Qt 3D using C++?

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 272 Views
  • 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.
  • A Offline
    A Offline
    andyP
    wrote on last edited by
    #1

    In Qt 3D using C++ I want to display a triangle mesh where I programatically provide the vertices and indices of vertices that make up the triangles.

    Should I use Qt3DRender::QGeometryRenderer for this or is there a more suitable subclass I can use?

    I notice that this class has a setGeometry() so my plan is to build a Qt3DRender::QGeometry and call this.

    However how do I set the vertices and indices of vertices on this geometry?

    I have:
    std::vector<float> vertices; // x1, y1, z1, x2, y2, z2, ...
    std::vector<unsigned int> indices; // tri1_i1, tri1_i2, tri1_i3, tri2_i1, ...

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved