[vtkusers] Off screen rendering multiple views

runel_krone at juno.com runel_krone at juno.com
Tue Mar 15 14:59:38 EDT 2011


I am trying to do off screen rendering of a volume. I am currently using windows xp, qt, and vtk, but will eventually be switching to linux. On screen rendering works fine. My volume displays normally and can be rotated and shifted without issue. In my final application I need to output three or four different png images of this volume from different angles (e.g. view from x axis, y axis, z axis, -z axis). When i switch my code to use off screen rendering the first rendered view is saved correctly to a PNG file. The rest of the views don't update so I end up with 3 copies of the first image. I have tried several different variations of this such as calling render from the interactor, calling render from the renderer itself, calling start and waitforcompletion on the window, calling modified on the data sets and filters. I seem to be missing something. Any help would be appreciated. Thanks, bwing My rendering code is as follows: VTK_CREATE(vtkWin32OpenGLRenderWindow, window);window->SetSize(1200, 600);window->AddRenderer(ren);window->OffScreenRenderingOn(); VTK_CREATE(vtkWindowToImageFilter, imageFilter);imageFilter->SetInput(window);    ren->AddVolume(volume);    window->Render();          writer->SetFileName((str +"yz.png").c_str());writer->Write();  window->SetSize(600, 1200);camera->SetPosition(position[0], position[1], position[2] + 288);window->Render();  writer->SetFileName((str +"xy.png").c_str());  writer->Write();writer->SetFileName((str +"xz.png").c_str());writer->Write(); window->SetSize(1200, 600);camera->SetPosition(position[0], position[1] + 96, position[2]);window->Render(); std::string str = "D:\data\";VTK_CREATE(vtkPNGWriter, writer);writer->SetInput(imageFilter->GetOutput());
____________________________________________________________
Groupon&#8482 Official Site
1 ridiculously huge coupon a day. Get 50-90% off your city's best!
http://thirdpartyoffers.juno.com/TGL3131/4d7fb720c74a61657a4st03vuc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110315/ea559b56/attachment.htm>


More information about the vtkusers mailing list