[vtkusers] How to animate/warp displacement ?

De Boer Ingo I.deBoer at polytec.de
Tue Apr 8 10:18:41 EDT 2003


Hi,

I didn't find any easy-to-understand sample on this.
Maybe someone can give some help on this?

I have 5 points, like:
vtkPoints *points = vtkPoints::New();
points->InsertPoint( 0, 0.0, 0.0, 0.0);
points->InsertPoint( 1, 1.0, 0.0, 0.0);
points->InsertPoint( 2, 1.0, 1.0, 0.0);
points->InsertPoint( 3, 0.0, 1.0, 0.0);
points->InsertPoint( 4, 0.5, 0.5, 0.0);

There is a displacement in 3 stages for each point.
The four corner points stay where they are. The middle
point (index 4) moves to the following points:
(0.5, 0.5, 0.25), (0.5, 0.75, 0.5), (0.5, 0.5, 1.0)

I have set the points into a vtkStructuredGrid, than used
a vtkStructuredGridGeometryFilter. After that I have do something 
like vtkWarpVector->SetInput(geomfilter->GetOutput()) right ?
But where do I have to put my actual displacement ?

Are ther any small/easy samples on this ?
I only found dispPlot.tcl but it loads a file I doesn't help
to understand what's behind all this. I converted the dispPlot
to C++ and used a Timer to change the ScaleFactor of the WarpVector
to do the actual animation, so that works...

thanks & greets
  Ingo



More information about the vtkusers mailing list