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. Q3D: creating custom geometry class C++
Forum Updated to NodeBB v4.3 + New Features

Q3D: creating custom geometry class C++

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 434 Views 2 Watching
  • 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.
  • V Offline
    V Offline
    VictorT
    wrote on last edited by VictorT
    #1

    Hello!

    I' m currently in the process of developing my own geometry class of some complex 3D shape in Q3D. I think that the right path is to do something like QCylinderMesh in Q3D extras (correct me if I'm wrong).

    First of all, it would be nice to learn the general pipeline of creating geometries in C++. The documentation is quite sparse on this topic.

    Now I'm trying to analise the Extras and I'm stuck with ruling out the use of the basic classes:

    • QGeometry
    • QGeometryView (can't find it in the available for developer headers)
    • QGeometryRenderer

    Tit would be nice to learn how this classes are related. The roles of this classes is also poorly documented, not enough to make custom Mesh class at least. May be some diagrams or at least textual description would also be very helpfull.

    Also the particular pain is the Private classes that are not accessible in the distribution of Qt Q3D and can't be inherited. So even inheritance from QGeometry tails the necesity to have QGeometryPrivate class which is hidden from the developer (as intended to).

    Any help or advise are appreciated.

    P.S.: I do NOT consider using Quick or QML for the time beeing since I've not found how to build some complex 3D shapes with it.

    kshegunovK 1 Reply Last reply
    0
    • V VictorT

      Hello!

      I' m currently in the process of developing my own geometry class of some complex 3D shape in Q3D. I think that the right path is to do something like QCylinderMesh in Q3D extras (correct me if I'm wrong).

      First of all, it would be nice to learn the general pipeline of creating geometries in C++. The documentation is quite sparse on this topic.

      Now I'm trying to analise the Extras and I'm stuck with ruling out the use of the basic classes:

      • QGeometry
      • QGeometryView (can't find it in the available for developer headers)
      • QGeometryRenderer

      Tit would be nice to learn how this classes are related. The roles of this classes is also poorly documented, not enough to make custom Mesh class at least. May be some diagrams or at least textual description would also be very helpfull.

      Also the particular pain is the Private classes that are not accessible in the distribution of Qt Q3D and can't be inherited. So even inheritance from QGeometry tails the necesity to have QGeometryPrivate class which is hidden from the developer (as intended to).

      Any help or advise are appreciated.

      P.S.: I do NOT consider using Quick or QML for the time beeing since I've not found how to build some complex 3D shapes with it.

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by kshegunov
      #2

      @VictorT said in Q3D: creating custom geometry class C++:

      correct me if I'm wrong.

      No, you're quite right.

      Now I'm trying to analise the Extras and I'm stuck with ruling out the use of the basic classes:

      • QGeometry

      This is what you want to implement. Fill your vertex attribute (and other data) there.

      • QGeometryView (can't find it in the available for developer headers)

      This appears to be new to Qt6, I haven't seen it before, but looks like some kind of a proxy to QGeometry. I'd ignore it for now.

      • QGeometryRenderer

      This is the way the geometry is rendered, most notably QMesh derives from this. You don't really need to touch any of it at this point.
      To show something, create your geometry implementation, create a default QGeometryRenderer set your geometry to it and add it to an QEntity somewhere in the scene. That's it, more or less.

      Also the particular pain is the Private classes that are not accessible in the distribution of Qt Q3D and can't be inherited. So even inheritance from QGeometry tails the necesity to have QGeometryPrivate class which is hidden from the developer (as intended to).

      Well, yes, in principle. But you could decide not to use the d-ptr idioum in your code at all.

      P.S.: I do NOT consider using Quick or QML for the time beeing since I've not found how to build some complex 3D shapes with it.

      I don't think you can define a geometry from QML to begin with.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      1
      • V Offline
        V Offline
        VictorT
        wrote on last edited by
        #3

        Thanks a lot!
        I've made what I planedScreenshot_20210326_121845.png

        Now I just need to fix some minor bugs

        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