Hi,<br>did you try to set the camera of one renderer to the other renderer?<br>someting like this:<br>renderer2->SetActiveCamera( renderer1->GetActiveCamera() );<br><br>This will do the trick if you use a camera-style interactor.<br>
<br>Hope that helps,<br>Jerome<br><br><div class="gmail_quote">2009/10/18 Yang, Jinzhong <span dir="ltr"><<a href="mailto:jinzhong76@gmail.com">jinzhong76@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Can anybody help me on this?<br>
Thanks.<br>
<div><div></div><div class="h5"><br>
-----Original Message-----<br>
From: Yang, Jinzhong [mailto:<a href="mailto:jinzhong76@gmail.com">jinzhong76@gmail.com</a>]<br>
Sent: Friday, October 16, 2009 3:59 PM<br>
To: 'VTK users group'<br>
Subject: Interaction Simultaneous for multiple renderers in one render<br>
window<br>
<br>
Hi All,<br>
<br>
I have a question on the interaction on the rendered window. Here is a<br>
snippet of my code:<br>
<br>
vtkRenderer* renderer1 = vtkRenderer::New();<br>
vtkRenderer* renderer2 = vtkRenderer::New();<br>
<br>
vtkRenderWindow* renWin = vtkRenderWindow::New();<br>
<br>
renWin->AddRenderer(renderer1);<br>
renWin->AddRenderer(renderer2);<br>
<br>
renderer1->SetViewport(0.0, 0.0, 0.5, 1.0);<br>
renderer2->SetViewport(0.5, 0.0, 1.0, 1.0);<br>
<br>
vtkRenderWindowInteractor* inter = vtkRenderWindowInteractor::New();<br>
inter->SetRenderWindow(renWin);<br>
<br>
... (Add mapping data to renderer1 and renderer2)<br>
<br>
// add axes<br>
vtkAxesActor* axes = vtkAxesActor::New();<br>
vtkPropAssembly* assembly = vtkPropAssembly::New();<br>
assembly->AddPart(axes);<br>
<br>
vtkOrientationMarkerWidget* widget1 = vtkOrientationMarkerWidget::New();<br>
widget1->SetOrientationMarker( assembly );<br>
widget1->SetInteractor(inter);<br>
widget1->SetViewport( 0.0, 0.0, 0.2, 0.2 );<br>
widget1->SetEnabled(1);<br>
widget1->InteractiveOff();<br>
<br>
renWin->Render();<br>
inter->Start();<br>
<br>
With this code, the object interactions in renderer1 and renderer2 are not<br>
correlated. Here, I would like the interactor (inter) acts simultaneously<br>
for objects in renderer1 and renderer2. For example, when I rotate or zoom<br>
in/out the object in renderer1, the object in renderer2 should change the<br>
same way as object in renderer1 does. Further, with this code, the axis<br>
orientation will change along the object orientation in renderer1, but not<br>
the one in renderer2. However, if I switch the Viewports of renderer1 and<br>
renderer2, the axis orientation will change along the object orientation in<br>
renderer2, but not the one in renderer1. Can anyone give me some hints to<br>
resolve this problem?<br>
<br>
Thank you!<br>
-Jinzhong<br>
<br>
<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br>