<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:΢ÈíÑźÚ
}
--></style>
</head>
<body class='hmmessage'>
Hi, vtk users<BR><BR>I am a beginner. <BR>&nbsp;<BR>I just want to render a 3d image in&nbsp;the same vtkRenderWindow without creating a new one.<BR>&nbsp;<BR>I create vtkrenderer and vtkrenderwindow before the loop.<BR>&nbsp;<BR>The 3d image is updated and rendered in the loop.<BR>&nbsp;<BR>
<STRONG>I have modified my code, but the 3d image is not rendered after it updated.</STRONG><BR>
&nbsp;<BR>My code is as fellows,&nbsp;please give me&nbsp;some advices.<BR>&nbsp;<BR>thank you.<BR><BR>&nbsp;<BR>&nbsp;vtkRenderer *aRenderer = vtkRenderer::New();<BR>&nbsp;vtkRenderWindow *renWin = vtkRenderWindow::New();<BR>&nbsp;renWin-&gt;AddRenderer(aRenderer);<BR>&nbsp;vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<BR>&nbsp;iren-&gt;SetRenderWindow(renWin);<BR>&nbsp;<BR>&nbsp;vtkContourFilter *contours = vtkContourFilter::New();<BR>
&nbsp;contours-&gt;SetInput(volumeimage);<BR>&nbsp;contours-&gt;SetValue(0,gval);<BR><BR>
&nbsp;vtkPolyDataMapper *contmap = vtkPolyDataMapper::New();<BR>&nbsp;contmap-&gt;SetInput(contours-&gt;GetOutput());<BR>&nbsp;contmap-&gt;SetScalarRange(100,220);<BR><BR>
&nbsp;vtkActor *contact = vtkActor::New();<BR>&nbsp;contact-&gt;SetMapper(contmap);<BR>&nbsp;aRenderer-&gt;AddActor(contact);<BR>&nbsp;<BR>&nbsp;vtkCamera *aCamera = vtkCamera::New();<BR>&nbsp;aCamera-&gt;ParallelProjectionOn();<BR>&nbsp;aRenderer-&gt;SetActiveCamera(aCamera);<BR>&nbsp;aRenderer-&gt;ResetCamera();<BR>&nbsp;aRenderer-&gt;SetBackground(0.725,0.725,1);<BR>&nbsp;renWin-&gt;SetSize(1024, 768);<BR>&nbsp;aRenderer-&gt;ResetCameraClippingRange ();<BR>
&nbsp;renWin-&gt;Render();<BR>&nbsp;iren -&gt;Initialize();<BR><BR>//&nbsp;loop <BR>for (int i=iFirstFrame; i&lt;iNumFrames; i++)<BR>{<BR>&nbsp; ......<BR>&nbsp; interpolate bmpimage into volumeimage;<BR>&nbsp; ......<BR>&nbsp; volumeimage-&gt;update();<BR>&nbsp;&nbsp;aRenderer-&gt;Render();<BR>
&nbsp; renWin-&gt;Render();<BR>&nbsp;&nbsp;iren-&gt;Render();<BR>}<BR>iren-&gt;Start();<BR><BR><BR>                                               </body>
</html>