[vtkusers] vtkCamera::SetPosition causes delayed rendering?
David Doria
daviddoria at gmail.com
Tue Jul 26 17:32:10 EDT 2011
I am trying to position the camera before the interaction starts. I tried
this:
vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
renderWindow->AddRenderer(renderer);
renderer->AddActor(contourActor);
renderer->AddActor(vertsActor);
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);
renderer->Render(); // This seems to construct the camera
renderWindow->Render();
vtkCamera* camera = renderer->GetActiveCamera();
//camera->SetPosition(400, 100, 100);
camera->SetFocalPoint(200, 0, 0);
renderer->Render();
renderWindow->Render();
renderWindowInteractor->Start();
If I uncomment the SetPosition call, then the render window is blank until I
perform some interaction (it's not like the camera is not aimed at the
scene, any tiny interaction and the scene is displayed properly.)
Can anyone explain how to tell it to "ReallyRender()" since Render() doesn't
seem to do the job?
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110726/f3cfe8f0/attachment.htm>
More information about the vtkusers
mailing list