get the current orientaion of an actor

Li Gao li at sourcesignal.com
Wed Jul 21 14:59:10 EDT 1999


Hello Bill,

Thanks for your reply. I downloaded the latest nightly release and couldn't
find the file "vtk/examplesTcl/savecamera.tcl". Could you send it through
email if you have it? The thing confused me is that my code was working
under vtk1.3 but not anymore.

Li

> -----Original Message-----
> From: owner-vtkusers at gsao.med.ge.com
> [mailto:owner-vtkusers at gsao.med.ge.com]On Behalf Of Bill Lorensen
> Sent: Tuesday, July 20, 1999 4:45 PM
> To: Li Gao; vtkusers at gsao.med.ge.com
> Subject: Re: get the current orientaion of an actor
>
>
> Look in vtk/examplesTcl/savecamera.tcl to see how to save the
> camera settings.
>
> Bill
>
> At 09:41 AM 7/20/99 -0700, Li Gao wrote:
> >Hello,
> >
> >I have some difficulties on getting the current orientation of
> an actor. My
> >purpose was to rotate an actor to a specific angle of interest and record
> >the orientaion so that I can simply display the subsequent actors at that
> >angle later without rotating each of them. What I did is the following:
> >
> >// First, after rotating the first actor, the orientation is
> saved in this
> >way. Am I right?
> >void CVtkView::RecordOrientaion()
> >{
> >         if (ren)
> >         {
> >                 double* angles =
> ren->GetActiveCamera()->GetOrientation();
> >                 myElevation = angles[0];
> >                 myRoll = angles[2];
> >                 myAzimuth = -angles[1];
> >         }
> >}
> >
> >// Then, I used the following section to force actor to a saved
> orientation.
> >Am I right?
> >void CVtkView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
> >{
> >         // initialization stuff and adding actors here
> >         // ...
> >         //
> >
> >         // set up the view angle
> >         this->ren->ResetCamera();
> >         this->ren->GetActiveCamera()->SetViewUp(0, 1, 0);
> >         this->ren->GetActiveCamera()->SetViewPlaneNormal(0, 0, 1);
> >         this->ren->GetActiveCamera()->Azimuth( myAzimuth );
> >         this->ren->GetActiveCamera()->Roll( myRoll );
> >         this->ren->GetActiveCamera()->Elevation( myElevation );
> >         this->ren->GetActiveCamera()->OrthogonalizeViewUp();
> >         this->ren->ResetCamera();
> >
> >         CView::OnUpdate(pSender, lHint, pHint);
> >}
> >
> >The above code only works under certain orientation (it worked under
> >vtk1.3). Could you help me find
> >out what was wrong? Thank you very much.
> >
> >Li
>
>
>
>
> ------------------------------------------------------------------
> -----------
> 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.
> ------------------------------------------------------------------
> -----------
>
>



-----------------------------------------------------------------------------
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