[vtkusers] how to output an avi file in VTK

Wang HJ hjwang126 at hotmail.com
Sun May 28 23:13:07 EDT 2006


Hi everybody

I have a program to render images in a loop (so it looks like an animation) 
in vtk, now I want to save those results in an avi file, I knew I could use 
the class vtkAVIWriter, but I do not know how to use it, I wrote my code 
like:
vtkAVIWriter *w=vtkAVIWriter::New();
w->SetFileName("c:/TestAVIWriter.avi");
w->Start();
  for (i = 0; i < 9; ++i)
    {
    // Render the image and rotate the active camera by one degree
    renWin->Render();
  // aRenderer->GetActiveCamera()->Azimuth(10);
   aRenderer->GetActiveCamera()->Elevation(-10);
   aRenderer2->GetActiveCamera()->Elevation(10);
   w->Write();
   }
   w->End();
......

but it did not write "*.avi" file at all.

it gave me this message:
ERROR: In .\vtkAVIWriter.cxx, line 74
vtkAVIWriter (025F39E8): Write:Please specify an input!

how can I connect the specify input  . Thanks in advance

HJ





More information about the vtkusers mailing list