[vtkusers] Help with blanket/surface plotting

James Dippner jdippner at informetric.com
Wed Aug 27 14:25:26 EDT 2008


Gerrick,
Thanks for your help, your suggestion clued me in to what I needed to do.

I was unable to get my result with the rectilinear grid, but I was able 
to achieve the result using the vtkStructuredGrid and 
vtkStructuredGridGeometryFilter. Essentially, I created an xy plot of 
the data points, and then added the z data as the scalar set to the 
vtkStructuredGridGeometryFilter. I am still confused as to why the rgrid 
classes didn't work, as the documentation suggests that they should. In 
the long run, I think I am better off using the struct grid classes anyway.

My modified pipeline is as follows:
x[10], y[5] ->
vtkPoints w/dimensions (10,5,1)->
vtkStructuredGrid w/ dimensions (10,5,1) ->
vtkStructuredGridGeometryFilter w/ z[50] vtkFloatArray ->
vtkWarpScalar w/ ScalarOn ->
vtkDataSetMapper ->
vtkActor -> renderer

Gerrick Bivins wrote:
>
> Did you specify scalar point or cell data? If so did you set one of 
> the arrays as the active scalar?
> I think vtkWarpScalar prints that info out if it can’t determine which 
> scalars to use.
> Gerrick
>
> On 8/26/08 11:26 AM, "James Dippner" <jdippner at informetric.com> wrote:
>
>     Thanks for the reply.
>     Yes, I did set the scale factor (ranging from 2.5 to 10) to no
>     effect. I also tried setting the USeNormalsOn, and explicitly
>     setting the Normal to (0,0,1). I'm thinking that my problem exists
>     on the grid or geometry setup, but I'm still trying to get my head
>     around the object model.
>
>     Gerrick Bivins wrote:
>
>
>         I know you may have done this but maybe not from the code
>         snippet below.Did
>         you specify a scale factor for your warp?
>
>
>         On 8/26/08 11:01 AM, "James Dippner"
>         <jdippner at informetric.com> <mailto:jdippner at informetric.com>
>         wrote:
>
>
>
>
>             Let me start by saying that I am new to using vtk, as in I
>             started
>             working with the toolkit over the weekend ;)
>
>             I am trying to plot a simple 3d blanket/surface plot of
>             data. Combing
>             through the examples, I put together a simple example that
>             I thought
>             would work, but I am apparently missing something.
>
>             I am working in C++, so I will spare you the detailed
>             code, but a
>             summary of the pipleline is as follows:
>
>             x[10], y[5], z[50] ->
>             vtkRectilinearGrid w/ dimensions (10,5,1) ->
>             vtkRectilinearGridGeometryFilter w/ extent (0,9, 0,4, 0,49) ->
>             vtkWarpScalar w/ XYPlaneOn ->
>             vtkDataSetMapper ->
>             vtkActor -> renderer
>
>             Despite much experimentation, my resulting plot is always
>             a flat xy
>             grid. Using the vtkRectilinearGrid::GetNumberOfPoints and
>             vtkRectilinearGrid::GetNumberOfCells functions, I get the
>             expected 36
>             cells and 50 points. With the vtkWarpScalar debugging on,
>             I get the
>             following message, "vtkWarpScalar (016C70D8): No data to
>             warp".
>             How do I warp the grid to show z as height? Am I not using
>             the right
>             classes, or have I simply set the classes up wrong?
>
>             Any help or suggestions would be much appreciated.
>
>             Thanks,
>             Jim
>
>
>
>
>
>
>
>
>

-- 



More information about the vtkusers mailing list