Compute wire mesh in Qt3D
-
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!
-
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!
@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 aGeometryRenderer
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? -
@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 aGeometryRenderer
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?@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).
-
The example you posted does exactly what you want (programmatically generating the surface and rendering it in 3D)
So what exactly is your question?@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.