<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><P>OK. I got it ! It needed a "wtif->Modified();".</P><P></P><P> vtkWindowToImageFilter *wtif = vtkWindowToImageFilter::New();<BR> wtif->SetInput(renWin);<BR><BR> vtkAVIWriter *avi = vtkAVIWriter::New();<BR> avi->SetInputConnection(wtif->GetOutputPort());<BR> avi->SetFileName(str);<BR><BR> avi->Start();<BR> CStringA txt;<BR> for(int i=0; i<m_cList.GetItemCount(); i++)<BR> {<BR> LoadAndDisplayFrame((LPCTSTR)m_cList..GetItemText(i, 0)); // Load and render vertex data from file</P><P> wtif->Modified();<BR> avi->Write();<BR> }<BR> avi->End();<BR> wtif->Delete();<BR> avi->Delete();<BR><BR></P><BR>--- Στις <B>Δευτ., 19/01/09, ο/η Konstantinos Kelg <I><kkelgeor@yahoo.gr></I></B> έγραψε:<BR><BLOCKQUOTE style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">Από:
Konstantinos Kelg <kkelgeor@yahoo.gr><BR>Θέμα: Re: [vtkusers] vtkAVIWriter problem.<BR>Προς: "Andre Gouws" <andre@ynic.york.ac.uk>, vtkusers@vtk.org<BR>Ημερομηνία: Δευτέρα, 19 Ιανουάριος 2009, 12:29<BR><BR><DIV id="yiv808169080"><TABLE cellspacing="0" cellpadding="0" border="0"><TBODY><TR><TD valign="top" style="font:inherit;"><P>The "LoadAndDisplayFrame" does this (loads the specified "frame" from disk and calls "renWin->Render();" and I see the change of frames on my window). But the AVI is repeating the same frame (which is the 1st in order).</P><P>I 've tried both, the window's Render() and the renderer's Render(), to update the scene.<BR></P><P>Both do update the window, but the animation is not OK.</P><P>Perhaps something is going wrong with "vtkWindowToImageFilter" ?</P><P>Thank you for your immediate response.<BR></P>--- Στις <B>Δευτ., 19/01/09, ο/η Andre Gouws
<I><andre@ynic.york.ac.uk></I></B> έγραψε:<BR><BLOCKQUOTE style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px;">Από: Andre Gouws <andre@ynic.york.ac.uk><BR>Θέμα: Re: [vtkusers] vtkAVIWriter problem.<BR>Προς:
kkelgeor@yahoo.gr<BR>Ημερομηνία: Δευτέρα, 19 Ιανουάριος 2009, 9:39<BR><BR><PRE>Are you explicitly telling the Renderer to Update (Render) between frames ..
you'll need to do this (can't see it in the code snippet you have given)
************************************************************************
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
> </PRE></BLOCKQUOTE></TD></TR></TBODY></TABLE><BR>
<HR size="1"><FONT size="-1" face="Arial">
Χρησιμοποιείτε Yahoo!<BR>
Βαρεθήκατε τα ενοχλητικά μηνύ ματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων <BR>
<A rel="nofollow" target="_blank" href="http://login.yahoo.com/config/mail?.intl=gr">http://login.yahoo.com/config/mail?.intl=gr</A> </FONT></DIV></BLOCKQUOTE></td></tr></table><br>
<hr size=1><font size=-1 face=Arial>
Χρησιμοποιείτε Yahoo!<br>
Βαρεθήκατε τα ενοχλητικά μηνύ ματα (spam); Το Yahoo! Mail διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών μηνυμάτων <br>
<a href="http://login.yahoo.com/config/mail?.intl=gr">http://login.yahoo.com/config/mail?.intl=gr</a> </font>