[vtkusers] How to handle camera to travel inside a tube or endoscopic view

Moreland, Kenneth kmorel at sandia.gov
Thu Feb 1 18:08:34 EST 2007


You can override the interaction mechanism by creating your own subclass
of vtkInteractorStyle.  This is briefly described in the VTK User's
Guide as well as some alternative methods.  vtkInteractorStyle has
several methods that you can override to perform actions on character,
mouse, and timer events.  Your easiest course of action is probably
copying and modifying an existing interactor style such as
vtkInteractorStyleFlight.

Of course, the interactor style will have to modify the vtkCamera
attached to the renderer so that it follows the line.  You may have
already discovered that that should be pretty easy.  You can set the
position to a point on the line you have generated and the focal point
to a position to a point on the line further along.  You probably also
want to set the view up vector to make sure that the camera doesn't go
all screwy (by, for example, suddenly flipping the image around 180
degrees).  You can fix that by calling the OrthogonalizeViewUp() method
after changing the position and focal point.  That may cause some camera
roll, but you can turn that into an advantage by adding roll to your
interactor style (say with the left and right arrows).

-Ken

> -----Original Message-----
> From: vtkusers-bounces+kmorel=sandia.gov at vtk.org [mailto:vtkusers-
> bounces+kmorel=sandia.gov at vtk.org] On Behalf Of vaibhav agarwal
> Sent: Wednesday, January 31, 2007 11:59 PM
> To: vtkusers at vtk.org
> Subject: [vtkusers] How to handle camera to travel inside a tube or
> endoscopic view
> 
> Hi,
> 
> (i am sorry to resend this mail as my previous mail
> hasn't reach on the mailing list in 3 days)
> 
> I am trying to simulate a medical data. I have the
> colon, it is a tube kind of structure. I have
> generated the axis of this complex structure. The tube
> like structure is hollow inside.
> 
> Now what i want, i want my camera to move along the
> direction of axis. So basically there would be two
> directions forward and backword along the axis, which
> i want to bind to two keys.
> 
> How should i go about this problem? Any suggestion,
> pointers or help is warmly welcomed.
> 
> vaibhav
> 
> 
> 
>
________________________________________________________________________
__
> __________
> Expecting? Get great news right away with email Auto-Check.
> Try the Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
> _______________________________________________
> 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





More information about the vtkusers mailing list