<DIV>Hello,</DIV> <DIV> </DIV> <DIV>I tried vtkRenderWindow::OffScreenRenderingOn today but it does not work.</DIV> <DIV> </DIV> <DIV>It would be really helpful if you could provide any examples.</DIV> <DIV> </DIV> <DIV>I turned it on and used vtkWindowToImageFilter to save a snapshot of the OffScreenRenderWindow to an image file( JPEG ) on disk but the image comes out to be a snaphot of the desktop when the code is executed.</DIV> <DIV> </DIV> <DIV>I am using the VTK + QT library written by Carsten Kibler. I suspect if that is giving the problem. Because My Application is developed with QT and VTK. So there is already a QT + VTK render window in which the model is being displayed. I am creating the offscreen render window after that, so i suspect there are some conflicts.</DIV> <DIV>Because if i turn the offscreenrendering to off ( which is the default ), the render window is not visible, which is not normally expected.</DIV>
<DIV> </DIV> <DIV>I am using offscreen rendering to find the volume enclosed between two surfaces.</DIV> <DIV> </DIV> <DIV> --- First i render the surface behind ---> extract the z-buffer of the offscreen window.</DIV> <DIV> </DIV> <DIV>---- Second i remove the surface behind and new render the front surface alone ---> extract the z-buffer again</DIV> <DIV> </DIV> <DIV>----- Subtracting both the Z-buffers would give me the volume.</DIV> <DIV> </DIV> <DIV>I earlier used vtkMassProperties but it does not give good results. Hence i resorted to the z-buffer technique.</DIV> <DIV> </DIV> <DIV>Here is the code i used for the offscreen rendering:</DIV> <DIV> </DIV> <DIV>************************************************************************************************</DIV> <DIV> </DIV><FONT size=2> <div>vtkOpenGLRenderer *pOffScreenRenderer = vtkOpenGLRenderer::New();</div> <div> </div> <div>vtkRenderWindow
*pOffScreenRenderWindow = vtkOpenGLRenderWindow::New();</div> <div>pOffScreenRenderWindow->OffScreenRenderingOn();</div> <div>pOffScreenRenderWindow->AddRenderer( pOffScreenRenderer );</div> <div>pOffScreenRenderWindow->Start();</div> <div>pOffScreenRenderWindow->SetSize( wx , wy ); </div> <div>pOffScreenRenderWindow->Render();</div> <div> </div> <div></FONT><FONT color=#008000 size=2>// render a surface now</div></FONT><FONT size=2> <div>pOffScreenRenderer->AddActor( pSurfaceActor );</div> <div>pOffScreenRenderer->Render();</div> <div>pOffScreenRenderWindow->Render();</div> <div> </div> <div>// save a snapshot to disk</div> <div>vtkWindowToImageFilter *pWindowImageFilter = vtkWindowToImageFilter::New();</div> <div>pWindowImageFilter->SetInput( pOffScreenRenderWindow );</div> <div></div> <div>vtkJPEGWriter *pImageWriter = vtkJPEGWriter::New();</div> <div>pImageWriter->SetInput( pWindowImageFilter->GetOutput() );</div>
<div>pImageWriter->SetQuality( 100 );</div> <div>pImageWriter->SetFileName( "coons_image.jpg" );</div> <div>pImageWriter->ProgressiveOff();</div> <div>pImageWriter->Write();</div> <div>pImageWriter->Delete();</div></FONT> <DIV> </DIV> <DIV>*************************************************************************************************</DIV> <DIV> </DIV> <DIV>Is there anything wrong with the code ?</DIV> <DIV><BR>Please Help !!!!!</DIV> <DIV> </DIV> <DIV>Thanks in Advance.</DIV> <DIV> </DIV> <DIV>Regards</DIV> <DIV> </DIV> <DIV>Deepak Roy</DIV> <DIV> </DIV> <DIV><BR><B><I>Sylvain Jaume <sylvain.jaume@kitware.com></I></B> wrote:</DIV> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Hi Deepak,<BR><BR>Have you tried
vtkRenderWindow::OffScreenRenderingOn?<BR>http://www.vtk.org/doc/nightly/html/classvtkWindow.html#803e4f1aba85b796a0f17b0ec84093f9<BR><BR>Cheers,<BR>Sylvain<BR><BR>Deepak Roy wrote:<BR><BR>> hello everybody,<BR>> <BR>> Do you know how to create an offscreen vtk render window in VTK ?<BR>> <BR>> I want to render into the off screen render window and then get its <BR>> z-buffer using GetZbufferData <BR>> <HTTP: classvtkRenderWindow.html#z3197_1 html 4.2 release doc www.vtk.org><BR>> () and work on its z-buffer.<BR>> <BR>> Or is there an offscreen buffer similar to vtkRenderWindow.<BR>> <BR>> Please Help.<BR>> <BR>> Thanks in advance.<BR>> <BR>> Regards,<BR>> <BR>> Deepak<BR>><BR>> ------------------------------------------------------------------------<BR>> Yahoo! DSL <BR>> <HTTP: evt="37474/*http://promo.yahoo.com/broadband/%20" us.rd.yahoo.com *http: pa.yahoo.com><BR>> Something to write home about. Just $16.99/mo.
or less<BR>><BR>>------------------------------------------------------------------------<BR>><BR>>_______________________________________________<BR>>This is the private VTK discussion list. <BR>>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>>Follow this link to subscribe/unsubscribe:<BR>>http://www.vtk.org/mailman/listinfo/vtkusers<BR>> <BR>><BR></BLOCKQUOTE> <DIV><BR></DIV><p>
                <hr size=1> <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/">Yahoo! Music Unlimited - Access over 1 million songs. Try it free.</a>