[vtkusers] 2 rendering windows same camera

Benoit Regrain benoit.regrain at creatis.insa-lyon.fr
Wed Mar 30 01:57:54 EST 2005


Hi,

To do this, you will use the vtkCommand class (or vtkCallbackCommand).

When you make an interaction in one frame, some event are sent by vtk. 
And when this event is sent, a callback function (when using vtkCallbackCommand)
or class (derived from vtkCommand) is called corresponding to sended event.

When seeing the documentation on the vtkCommand class, you have the list of 
all event that occur in vtk.

Cheers
Benoit



  ----- Original Message ----- 
  From: Ilinca, Radu 
  To: vtkusers at vtk.org 
  Sent: Tuesday, March 29, 2005 8:45 PM
  Subject: [vtkusers] 2 rendering windows same camera


  Dear List: 

  I have 2 rendering windows controlled with the same camera. In this way, whenver I interact with the first window, the similar effect can be observed in the 2nd windows. however, i have to click first on the 2nd window in order to see the results (refresh) which is not what I expected. I want the results to be observable SIMULTANEOUSLY in the 2nd window. So, in real-time. Have any ideas please ? 
  Here is my relevant source code: 

  renderer->SetBackground(0.0, 0.0, 0.0); 
  renderer->AddVolume(volume); 
  renderer->GetActiveCamera()->Azimuth(20.0); 
  renderer->GetActiveCamera()->Dolly(1.60); 
  renderer->ResetCameraClippingRange(); 
  renwin->AddRenderer(renderer); 
  iren->SetRenderWindow(renwin); 


  vtkLight *pLight = vtkLight::New(); 
  renderer2->SetActiveCamera(renderer->GetActiveCamera()); 
  pLight->SetPosition(renderer->GetActiveCamera()->GetPosition()); 
  renderer->AddLight(pLight); 
  renderer2->AddLight(pLight); 

  renderer2->SetBackground(0.0, 0.0, 0.0); 
  renderer2->AddVolume(volume); 
  renderer2->ResetCameraClippingRange(); 
  renwin2->AddRenderer(renderer2); 
  iren2->SetRenderWindow(renwin2); 

  Thanks, 
  Radu. 





------------------------------------------------------------------------------


  _______________________________________________
  This is the private VTK discussion list. 
  Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
  Follow this link to subscribe/unsubscribe:
  http://www.vtk.org/mailman/listinfo/vtkusers
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050330/aaaae0a6/attachment.htm>


More information about the vtkusers mailing list