PDA

View Full Version : plotting 3D



QJak
20th June 2019, 12:18
hi. i am using qwt writen by Uwe for plotting 2D that is very usefull for me. Now i need to plot in 3D in Qt. please help me to do this.

d_stranz
20th June 2019, 17:40
As far as I know, there is no general-purpose 3D scientific plotting package using Qt that is similar to Qwt or QCustomPlot. I have looked and looked with no success.

You can take a look at Qt Data Visualization, but it has a couple of drawbacks: 1) it is licensed as GPL, which means you cannot use it in a commercial application unless you have a Qt Commercial license, and 2) the architecture severely limits what you can do with it. Maybe my opinion is because I am put off by the fact that most of the examples are for QML / QtQuick, but I also don't see where there are straightforward ways to extend the functionality, So I have looked at it, but not in any great detail.

anda_skoa
21st June 2019, 10:20
Similar to d_stranz I am not aware of any Qt specific 3D plotting library.

Many projects seem to use VTK though https://vtk.org/Wiki/VTK

But anything that renders with OpenGL can probably easily be integrated

Cheers,
_

QJak
21st June 2019, 13:53
thanks d_sranz and anda_skoa. In my project, i need to do under things:
1- the project is not commercial
2- i need to compile static and using stand alone
3- plotting some points on (x, y, z) and differents color
4- plotting cube, conic, ... in 3D with abillity of zooming and rotating
5- plotting lines from some points to another points in 3D with differents color
6- by clicking on lines or shapes some events must happen( like slot and signal in Qt)
7- IDE that i will use, must have a good online support like qtcenter:o

i am going to research about vtk that anda_skoa told. If another IDE can help me for doing above 7 things, please tell me.
thanks alot

d_stranz
21st June 2019, 17:27
I have seriously considered VTK many times, but it is a very big, powerful, and complex library with a steep learning curve. It can be integrated easily into Qt (there is a QVTKWidget or something like it). But the amount that I would have to learn in order to use it has always stopped me for lack of time.

d_stranz
24th June 2019, 17:54
You have me looking at VTK again. VTK now has a Charts API (https://blog.kitware.com/3d-charts/), which allows you to create interactive 3D plots. The post I linked is old, so no doubt there has been progress since then.

Creating the simple plot shown in the blog still takes a whole page of code, so it isn't as simple as QCustomPlot, but it is a step in the right direction.