I have the data - 2D discrete Fourier transform results. I want to gain heightmap but i dont know how to form heightmap. I need plot this data as surface in Q3DSurface through heightmap (not just 2D array).
QHeightMapSurfaceDataProxy
's constructor takes an image or an image file as an argument. All you need to do is create this image and load it.
Images can easily be generated from a 2D array since the indices used to point at a specific value stored in it can be interpreted as X,Y, while the value at the specific pair of indices as the Z coordinate.
Example:
If you have the following assignment
myarr[2][10] = 200;
you can read it as X=2, Y=10 and Z=200, which would mean that pixel at location [2;10] has value 200.
The size of the image is calculated by taking the dimensions of your array. If you have 10x15 elements your image will be 10x15 pixels. Check how to populate a QImage
to have a more accurate code and not my pseudo-code from above.