[vtkusers] MAC offscreenrendering
Matthias Müller
mmueller at symbios.ch
Mon Jun 27 10:22:46 EDT 2011
Hello,
When I implement offscreen rendering on mac there is always a white window poping up The offscreen rendering itself seems to work correctly: the generated image file contains my vtk Scene.
VTK 5.6 (compiled with Cocoa and Mesa)
Mac OSX 10.6.7
Example sourcecode:
vtkSmartPointer<vtkRenderer> renderer = vtkRenderer::New();
vtkSmartPointer<vtkRenderWindow> renWin = vtkRenderWindow::New();
renWin->SetOffScreenRendering(1);
renWin->AddRenderer(renderer);
// sphere1: the outer sphere
vtkSmartPointer<vtkSphereSource> sphere1 = vtkSphereSource::New();
sphere1->SetThetaResolution(100);
sphere1->SetPhiResolution(100);
sphere1->SetRadius(1);
sphere1->Update();
vtkSmartPointer<vtkPolyDataMapper> sphereMapper = vtkPolyDataMapper::New();
sphereMapper->SetInputConnection(sphere1->GetOutputPort());
vtkSmartPointer<vtkActor> sphereActor = vtkActor::New();
sphereActor->SetMapper(sphereMapper);
renderer->AddActor(sphereActor);
renderer->SetBackground(1,1,1);
renWin->SetSize(300,300);
vtkSmartPointer<vtkWindowToImageFilter> toImage = vtkWindowToImageFilter::New();
toImage->SetInput(renWin);
renWin->Render();
vtkSmartPointer<vtkPNGWriter> writer = vtkPNGWriter::New();
writer->SetInput(toImage->GetOutput());
writer->SetFileName("***some filename**");
writer->Write();
How can I get rid of the annoying popup window?
Please advise
Matthias
NOTICE: This message and its attachments, if any, are strictly private and contain
confidential information intended for the exclusive use of the person(s) named above.
If you have received this message by error and are not the intended recipient,
please immediately advise us by phone (+41244242626) or by e-mail (info at symbios.ch)
and delete it. This message and its attachments may not be divulged to a third party
nor may it be used for any purpose whatsoever, reproduced, filed or stored on any
medium whatsoever.
AVIS : Ce message et ses eventuelles annexes sont confidentiels. Si vous avez recu
ce message par erreur ou n'etes pas dans la liste des destinataires, veuillez nous en
informer immediatement par telephone (+41244242626) ou par e-mail (info@ symbios.ch)
et detruisez-le. Vous vous abstiendrez de divulguer le contenu de ce message
et ses annexes ` une tierce personne, d'utiliser ce message dans quelque but que ce soit,
de le stocker ou copier son contenu sur quelque support que ce soit.
More information about the vtkusers
mailing list