[vtkusers] Set actor topmost

David E DeMarle dave.demarle at kitware.com
Mon Jan 2 11:17:44 EST 2012


Try making the static camera watch modified events from the dynamic one and
when the callback happens set the transform of the watcher to that of the
watched.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Tue, Dec 27, 2011 at 11:46 PM, zlf <jxdw_zlf at yahoo.com.cn> wrote:

> Hi all,
>
> There are two sphere actors in my scene. I tried to set a sphere topmost.
> But when I move the camera by mouse, only renderer1's camera is changed,
> renderer2's camera is kept unchanged.
>
>            vtkRenderWindow renwin = new vtkRenderWindow();
>            renwin.SetParentId(this.Handle);
>            renwin.SetSize(this.Width, this.Height);
>
>            vtkRenderer renderer1 = new vtkRenderer();
>            renderer1.SetLayer(1);
>
>            vtkRenderer renderer2 = new vtkRenderer();
>            renderer2.SetLayer(0);
>
>            renwin.AddRenderer(renderer1);
>            renwin.AddRenderer(renderer2);
>
>            renwin.SetNumberOfLayers(2);
>
>            vtkRenderWindowInteractor iren = new
> vtkRenderWindowInteractor();
>            iren.SetRenderWindow(renwin);
>
>            vtkInteractorStyleTrackballCamera style = new
> vtkInteractorStyleTrackballCamera();
>            iren.SetInteractorStyle(style);
>
>           // Create a sphere actor and add it to renderer1
>           // Create another sphere actor and add it to renderer2
>
>            renwin.Render();
>
> Thanks
>
> superZZ
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Set-actor-topmost-tp5104451p5104451.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK 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/20120102/c6599032/attachment.htm>


More information about the vtkusers mailing list