[Paraview-developers] paraview rendering problem after vtkCamera updated

Li Guan li.9uan at gmail.com
Mon Apr 9 02:23:32 EDT 2012


Hi,

I am writing a plugin to change window size, change camera to designated
pose and hope to grab Z-buffer for a 3D model that I am rendering. What I
found is that after I set a new window size, set a new camera position,
viewup direction, focal point, and render the window, the 3D model
disappeared. But after I drag with my mouse in the empty window, the 3D
model shows up. Not sure what I did incorrectly...

Here are my code segment:

if(proxy){
      proxy->GetRenderWindow()->Render();

      vtkCamera *camera = proxy->GetActiveCamera();
      //proxy->GetRenderer()->ResetCamera();
      camera->SetParallelProjection(false);
      camera->SetFocalPoint(-4.63865, 1.56608, 51.092);
      camera->SetViewUp(0.9435, 0.1077, 0.3134);
      camera->SetPosition(-9.4128, 9.97, 62.5772);
      int h = 480, w = 640;
      proxy->GetRenderWindow()->SetSize(w,h);
      proxy->GetRenderWindow()->Render();
}

Hope anyone can explain a bit. Thanks,

Li
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20120409/2df94516/attachment.htm>


More information about the Paraview-developers mailing list