3D Axis

Vamsidhar Juvvigunta vamsidha at merl.com
Wed Jun 30 17:50:01 EDT 1999


> the 3D axis to change accordingly, but remain in the bottom corner of
> the window.  I've been 'playing' with vtkAxis and vtkFollower (to keep
> the XYZ labels oriented properly), but my ad hoc solution seems to be
> getting very complicated for a task that I'd imagine is quite routine
> for many people.  Also, the axis doesn't stay in the corner of the
> window as I'd like it to.  I've included some parts of my code below

 The origin of the Axis is always specified in Object Coordinates. Once
you start rotating the object with the axes at some corner of your
viewport the axis's origin might disappear off your viewing frustum.

 The best thing would be to use an method that does a

1) renWin->SetDisplayPoint() or the like to specify the display coords at
which you want the origin of your axes to appear.

2) Get the object coords of the same using a
   renWin->DisplayToObject like command
3) axes->SetOrigin() to the object coords you arrived at

 Now this is definitely doing too much work. As to where you could do
this, I am not entirely sure. Some body might have a more elegant 
solution. The Commands above are from memory so may not be the exact ones,
please look at the man pages.

 I always want my Axis to be centered at the actor so I never had this
issue to face.

 You could alternately use a second renderer in the same render window
with it's viewport at the corner you like, containing only the axes actor. 
Tie the two camera's together and do additional things to remove the zoom
and translate methods. Your main renderer's viewport will have to be
adjusted accordingly of course.

 Again too much work. But should work.

-vamsi



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------





More information about the vtkusers mailing list