[vtkusers] pipeline update and animation

Christopher.Moore at noaa.gov Christopher.Moore at noaa.gov
Tue Feb 17 21:16:55 EST 2004


I'm trying to animate PolyData by creating an array of PolyData[5] when
the application initializes.  Then, when the user presses a button, I'd
like to simply loop through, rendering each one in succession.

To initialize the array, I do:

  for (t=0; t < NTIMES; t++ ) {

    (re-set pdCurrents' vectors)

    vtkGlyph3D *arrows = vtkGlyph3D::New();
    arrows->SetInput(pdCurrents);
    arrows->SetSource(arrow->GetOutput());

    pdCurrentsArray[t] = vtkPolyData::New();
    arrows->Update();
    pdCurrentsArray[t]->DeepCopy(arrows->GetOutput());
  }

then I create a Mapper & Actor, and render pdCurrentsArray[0] to the 
scene.  This works so far (the first time step renders).

To animate, I figure I can simply re-set the Mapper input to 
pdCurrentsArray[1], pdCurrentsArray[2], etc:

(loop over step)
currentMapper->SetInput(pdCurrentsArray[step]);
renWin->Render();
(end loop)

This doesn't work.  Even if I call Update() on the Mapper, or Modified() 
on the PolyData.

Any ideas?

Cheers,
Chris

__________________________________________________________________
Christopher Moore                email: Christopher.Moore at noaa.gov
Research Scientist, Oceanography                 tel: 206.526.6779
University of Washington/JISAO/NOAA-PMEL         fax: 206.526.6744
------------------------------------------------------------------

ps - vtk4.2, RH9, XOpenGLRenderWindow and Motif for handling the event 
loop...

pps - I want to initialize the geometry "ahead of time" because it takes
too long _during_ the animation to do so.  Other Actors are animated in
the step-loop in the classic way (without breaking the pipeline) by simply
modifying the input DataSet can calling Modified().




More information about the vtkusers mailing list