[vtkusers] Help with vtkDoubleArray and vtkWarpScalar

Janny Dong janny.dong at gmail.com
Tue May 15 12:05:36 EDT 2007


Hi, all

I have the data points like (X,Y,Z). (X,Y) is the position of the data
points on the map. Z is the height that I am trying to represent with
colors.

For example, the data are like

{0,0,60.3}, {0,1,60.2},{0,2,60.1},{0,3,60.0},
{1,0,59.9},{1,1,59.8}, {1,2,59.7},{1,3,59.6},
{2,0,59.6}, {2,1,59.5},{2,2,59.3},{2,3,59.5},
{3,0,59.6}, {3,1,59.7}, {3,2,59.9}, {3,3,60.1}

 I tried to put my data in vtkDoubleArray and then create vtkImageData. Then
I used vtkWarpScalar to get a 3D colored surface. Basically I'd like to
generate a surface as MATLAB functions surf() and meshgrid() do. I must have
done something wrong in this procedure since I got nothing in the rendering
window.

Is there any sample code for this? Or is there any better way to generate a
color map out of such kind of data?

Thanks a lot.
Janny
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070515/414b193b/attachment.htm>


More information about the vtkusers mailing list