<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
I'm writing a short program to store a series of&nbsp;scences from an offscreen render window.&nbsp; The following is the code snippet that writes the (offscreen) render window in a series of files as the position of an object moves.<BR>
&nbsp;<BR><FONT size=2>
</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>for</FONT></FONT><FONT size=2> (</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2> i=0; i&lt;36; ++i)<BR>
{<BR>
&nbsp; cone-&gt;SetCenter(3.0-i*1.0/100.0, -1.0, 0.0);<BR>
&nbsp; mRenWin-&gt;Render();<BR>
&nbsp;<BR>
&nbsp; std::stringstream s;<BR>
&nbsp; s &lt;&lt; </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"C:\\OffScreenTest\\scence"</FONT></FONT><FONT size=2> &lt;&lt; i &lt;&lt; </FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>".png"</FONT></FONT><FONT size=2>;<BR>
&nbsp; vtkWindowToImageFilter* w2if = vtkWindowToImageFilter::New();<BR>
&nbsp; w2if-&gt;SetInput(mRenWin);<BR>
&nbsp; vtkPNGWriter* wr = vtkPNGWriter::New();<BR>
&nbsp; wr-&gt;SetInputConnection(w2if-&gt;GetOutputPort());<BR>
&nbsp; wr-&gt;SetFileName(s.str().c_str());<BR>
&nbsp; wr-&gt;Write();<BR>
}<BR></FONT>
<BR>You can see I have to create new vtkWindowToImageFilter and vtkPNGWriter objects for each iteration inside the loop to save the updated render window.&nbsp; Otherwise,&nbsp;only the screen of the first scene is saved.<BR>
&nbsp;<BR>
What did I do wrong?<BR>
&nbsp;<BR>
Thanks!<BR>
<BR>Xiaofeng Zhao<BR><BR><BR><BR><br /><hr />Insert movie times and more without leaving HotmailŪ. <a href='http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009' target='_new'>See how.</a></body>
</html>