[vtkusers] vtkAVIWriter problem.

Andre Gouws andre at ynic.york.ac.uk
Mon Jan 19 04:44:19 EST 2009


I usually just use vtkLineSource (has SetPoint1 and SetPoint2 calls once you have calculated the positions) .. example from the vtk source (Python sorry)

rake = vtk.vtkLineSource()
rake.SetPoint1(15, -5, 32)
rake.SetPoint2(15, 5, 32)
rake.SetResolution(21)

.... addmapper ...

.... addactor ... etc.


************************************************************************

Andre Gouws
York Neuroimaging Centre



Konstantinos Kelg wrote:
>
> Hi. I 'm trying to make a 3D animation (loading vertex data from files 
> and rendering them), and I have some problems: I must either make an 
> animated gif (which VTK doesn't seem to support - does it ?) or make 
> an AVI, because the real time animation is too slow. So I started 
> trying the 2nd solution and I have some problems:
>
> - At first I got linker errors when I constructed a "vtkAVIWriter" 
> object. I 've finally managed to work this out by importing the needed 
> Windows library (I post it here just in case someone has the same 
> problem again):
>
>     #pragma comment(lib,"Vfw32.lib") // that's all
>
> - Now I have written this code:
>
>  vtkWindowToImageFilter *wtif = vtkWindowToImageFilter::New();
>  wtif->SetInput(renWin);
>
>  vtkAVIWriter *avi = vtkAVIWriter::New();
>  avi->SetInputConnection(wtif->GetOutputPort());
>  avi->SetFileName(str);
>
>  avi->Start();
>  CStringA txt;
>  for(int i=0; i<m_cList.GetItemCount(); i++)
>  {
>   LoadAndDisplayFrame((LPCTSTR)m_cList.GetItemText(i, 0)); // Load and 
> render vertex data from file
> // wtif->SetInput(renWin);
> // avi->SetInputConnection(wtif->GetOutputPort());
> // avi->Update();
>   avi->Write();
>  }
>  avi->End();
>  wtif->Delete();
>  avi->Delete();
>
> This produes an AVI but it always shows the same animation frame 
> (nothing changes).
>
> Does anyone know what should I do to make right ?
>
>
> ------------------------------------------------------------------------
> Χρησιμοποιείτε Yahoo!
> Βαρεθήκατε τα ενοχλητικά μηνύ ματα (spam); Το Yahoo! Mail διαθέτει την 
> καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων
> http://login.yahoo.com/config/mail?.intl=gr
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
>   



More information about the vtkusers mailing list