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. Compute wire mesh in Qt3D
QtWS25 Last Chance

Compute wire mesh in Qt3D

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 351 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.
  • Q Offline
    Q Offline
    QtUser467
    wrote on last edited by
    #1

    I would like to draw a mesh surface and additional objects in a 3D scene. The goal is to programmatically change these objects and the shape of the surface (basically, it will show a response surface (function) in 3D) and some 'data objects' in 3d space.

    The response surface would be something like this (https://doc.qt.io/qt-5/images/surface-example.png), but half transparent so that one can see through it.

    I now am unsure how this is best done in Qt3D (and whether Qt3D is the best way to proceed). The mesh examples I have seem so far used a pre-defined mesh (e.g. created in Blender). What I would have is basically a function z = f(x,y), and I would like to dynamically be able to recompute the mesh by changing some parameter in the function. In other words, I'd need to produce the mesh object programmatically, and be able to alter the Z coordinates of the vertices while the program is running.

    What would be the best way to achieve this?

    Thanks for your help!

    kshegunovK 1 Reply Last reply
    0
    • gde23G Offline
      gde23G Offline
      gde23
      wrote on last edited by
      #2

      The example you posted does exactly what you want (programmatically generating the surface and rendering it in 3D)
      So what exactly is your question?

      Q 1 Reply Last reply
      0
      • Q QtUser467

        I would like to draw a mesh surface and additional objects in a 3D scene. The goal is to programmatically change these objects and the shape of the surface (basically, it will show a response surface (function) in 3D) and some 'data objects' in 3d space.

        The response surface would be something like this (https://doc.qt.io/qt-5/images/surface-example.png), but half transparent so that one can see through it.

        I now am unsure how this is best done in Qt3D (and whether Qt3D is the best way to proceed). The mesh examples I have seem so far used a pre-defined mesh (e.g. created in Blender). What I would have is basically a function z = f(x,y), and I would like to dynamically be able to recompute the mesh by changing some parameter in the function. In other words, I'd need to produce the mesh object programmatically, and be able to alter the Z coordinates of the vertices while the program is running.

        What would be the best way to achieve this?

        Thanks for your help!

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

        @QtUser467 said in Compute wire mesh in Qt3D:

        I now am unsure how this is best done in Qt3D (and whether Qt3D is the best way to proceed).

        About the first part:
        Create your custom geometry class and add it to a GeometryRenderer instance. Add the shaders you desire and that should do it. Transparency may require multi-pass (deferred) rendering, so you may want to check that example.

        As for the second part:
        No one can say that but you.

        The response surface would be something like this (https://doc.qt.io/qt-5/images/surface-example.png), but half transparent so that one can see through it.

        Can't you use the Qt Data Visualization module directly?

        Read and abide by the Qt Code of Conduct

        Q 1 Reply Last reply
        0
        • kshegunovK kshegunov

          @QtUser467 said in Compute wire mesh in Qt3D:

          I now am unsure how this is best done in Qt3D (and whether Qt3D is the best way to proceed).

          About the first part:
          Create your custom geometry class and add it to a GeometryRenderer instance. Add the shaders you desire and that should do it. Transparency may require multi-pass (deferred) rendering, so you may want to check that example.

          As for the second part:
          No one can say that but you.

          The response surface would be something like this (https://doc.qt.io/qt-5/images/surface-example.png), but half transparent so that one can see through it.

          Can't you use the Qt Data Visualization module directly?

          Q Offline
          Q Offline
          QtUser467
          wrote on last edited by
          #4

          @kshegunov said in Compute wire mesh in Qt3D:

          Can't you use the Qt Data Visualization module directly?

          Well, I did, but I think I cannot add objects additional to the surface. Also, transparancies do not look like I would expect them, at least not with QLinearGradient (they are not transparent, and I do see stripes that look like some artifact).

          1 Reply Last reply
          0
          • gde23G gde23

            The example you posted does exactly what you want (programmatically generating the surface and rendering it in 3D)
            So what exactly is your question?

            Q Offline
            Q Offline
            QtUser467
            wrote on last edited by
            #5

            @gde23 said in Compute wire mesh in Qt3D:

            The example you posted does exactly what you want (programmatically generating the surface and rendering it in 3D)
            So what exactly is your question?

            As I wrote, adding transparency and graphical elements in addition to the surface. If I use the surface example, I just have the surface and no transparency. That led me to suspect I somehow need to start directly from Qt3D.

            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