I have height point data that shape of 2D matrix.
Which is best way to visualize that data.
Hi, friend,
Do you wish to view it as a “heat map” 2D image, as a 3D surface or as contour lines?
regards,
Paulo
Thanks, Paulo.
I want to view as 3D surface my data like the below image.
My data consists of float array value and it has different row spacing and col spacing.
So I try to use vtkImageData, but I don’t know how to do that.
Is it right way or not? Do I need another data object?
Regards.
Hello, friend,
Please, take a look at this code: https://github.com/PauloCarvalhoRJ/gammaray/blob/master/viewer3d/view3dbuilders.cpp . Look for a method called buildForSurfaceCartesianGrid2D()
. A 2D Cartesian grid is exactly an array of values like yours. This will build a surface from your data.
regards,
Paulo
You could try something like this: InterpolateMeshOnGrid. I’m pretty sure the gridActor is the one you want. So comment out the line:
renderer->AddActor(randomActor);
The randomActor
is just the surface.
Comment out:
gridActor->GetProperty()->SetColor(0.0, 0.0, 1.0); //(R,G,B)
and set:
gridMapper->ScalarVisibilityOn();
This will give you a rather garish default height map. You can improve this by using color maps etc.
Once you are happy with what you are doing, look at a really complex example: ElevationBandsWithGlyphs