[vtkusers] How to generate a 3D surface from a regular 2D array of elevations?

Amy Squillacote amy.squillacote at kitware.com
Wed May 23 16:23:46 EDT 2007


Hi Steve,

You could try the following. From your array of floating-point values 
(2D location + elevation), create a vtkPoints 
(http://www.vtk.org/doc/nightly/html/classvtkPoints.html). Set this as 
the points for a vtkPolyData object 
(http://www.vtk.org/doc/nightly/html/classvtkPolyData.html). Then pass 
the vtkPolyData object through a vtkDelaunay2D filter 
(http://www.vtk.org/doc/nightly/html/classvtkDelaunay2D.html). The 
output is a vtkPolyData, and this way you don't have to manually create 
the cells connecting the points.

- Amy

Steve Chall wrote:
>
> I’ve ordered the three books but in the meantime I’m subsisting on 
> online and the docs installed with vtk. Beginners’ question: Is there 
> an example of the following? I want to read in a regular 2D array of 
> double float values and display it as a 3D surface, where the 2 
> indices for each array element represent a location on the earth’s 
> surface and the value of each element represents an elevation. In 
> fact, I want to be able to display a sequence of surfaces 
> (representing a corresponding sequence of 2D arrays) of elevations as 
> an animation of interactively variable speed. From what I can see I 
> need to get the data into a vtkPolyData object, after which I can 
> display it and manipulate its visual representation just like in the 
> tutorials. But vtkPolyVertex, vtkTriangleStrip, and 
> vtkUnstructuredGrid are just a few of the candidates for an initial 
> intra-VTK format, and it’s not clear to me which is most appropriate. 
> Thanks very much for any help you may be able to provide.
>
> -Steve C.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   

-- 
Amy Squillacote
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
Phone: (518) 371-3971 x106




More information about the vtkusers mailing list