Hi again,<br><br>thanks for your answer Seb. Offscreen rendering was the keywords I was missing for a successfull search. <br>Anyway, I have been reading other posts about this topic and realized that rendering with OSMesa will be slower as is not hardware accelerated, is that true?. As I intend to use the Offscreen rendering for batch processing, I really need the rendering to be fast... I am using Linux with Nvidia Card... Any other ideas?<br>
<br>Thanks<br><br><div class="gmail_quote">On Wed, Jul 7, 2010 at 1:58 PM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Aitor,<br>
<br>
The only way to prevent the window from poping up, is to use the<br>
Offscreen option and compile vtk with OSMesa.<br>
Otherwise, even in Offscreen mode, a black window will popup and disappear.<br>
<br>
Seb<br>
<div><div></div><div class="h5"><br>
On Wed, Jul 7, 2010 at 7:36 AM, Aitor Aldomā <<a href="mailto:aldoma.aitor@gmail.com">aldoma.aitor@gmail.com</a>> wrote:<br>
> Hi everybody,<br>
><br>
> I want to generate 2D views of a 3D model and save them as jpeg image. At<br>
> the moment, I am using vtkWindowToImageFilter to obtain the generated view<br>
> from a RenderWindow. The problem is that I dont want to display the window<br>
> on the screen, just wan the RenderWindow to render the view and store the<br>
> result with vtkWindow without showing the window.<br>
><br>
> This is part of the code i am using now, the problem is that the window will<br>
> flash for a short time and then disapper. Is there a way to render the view<br>
> without being displayed on the screen???<br>
><br>
> renWin = vtk.vtkRenderWindow()<br>
> renWin.AddRenderer(ren)<br>
> ren.SetBackground(1, 1, 1)<br>
> renWin.SetSize(128,128)<br>
><br>
> ren.Render()<br>
><br>
> winToImageFilter = vtk.vtkWindowToImageFilter()<br>
> winToImageFilter.SetInput(renWin);<br>
><br>
> renWin.Finalize()<br>
> winToImageFilter.Update()<br>
><br>
> jw = vtk.vtkJPEGWriter();<br>
> jw.SetInput(winToImageFilter.GetOutput());<br>
><br>
> jw.SetFileName(fileName + ".jpg");<br>
> jw.Write();<br>
><br>
> Thanks in advance<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br>