[vtkusers] Re: vtkCamera::SetViewPlaneNormal how to replace

Jaco Schieke schieke at cae.wisc.edu
Fri Feb 1 13:48:49 EST 2002


Thanks for the help.  The solution that did the trick for me was:

from Numeric import array
camera.SetFocalPoint(tuple(plane_origin))
camera.SetPosition(plane_origin+distance*array(normal))
ren.ResetCameraClippingRange()
camera.SetViewUp((0,0,1))

Jaco Schieke

----- Original Message -----
From: "Jeff Lee" <jeff at cdnorthamerica.com>
To: "Jaco Schieke" <schieke at cae.wisc.edu>
Cc: <vtkusers at public.kitware.com>; <ehrhardt at medinf.mu-luebeck.de>
Sent: Thursday, January 31, 2002 6:18 AM
Subject: Re: [vtkusers] RE: vtkCamera::SetViewPlaneNormal how to replace


> I do something like
>
>     cam.SetFocalPoint(fp);
>     cam.SetPosition(pos);
>     cam.ComputeViewPlaneNormal();
>     cam.SetViewUp(up);
>     cam.OrthogonalizeViewUp();
>
> -Jeff
>
> Jaco Schieke wrote:
>
> >I would like to do the same as Jan.  I have a plane (with a normal) at
which I want the camera to look straight at.  Since
> >SetViewPlaneNormal is now deprecated, how do one go about this?
> >
> >Thanks, and I hope it's third time lucky for this post.
> >
> >Jaco Schieke
> >
> >>>Hello,
> >>>
> >>I have some methods to switch the directions,
> >>from where I see my objects:
> >>
> >>ViewFront:
> >>  camera->SetViewUp(m_ViewUp);
> >>  camera->SetViewPlaneNormal(m_ViewNormal);
> >>  m_Renderer->ResetCamera();
> >>
> >>ViewBack:
> >>  for(int i=0;i<3;i++) {
> >>    view_normal[i] = -1 * m_ViewNormal[i];
> >>  }
> >>  camera->SetViewUp(m_ViewUp);
> >>  camera->SetViewPlaneNormal(view_normal);
> >>  m_Renderer->ResetCamera();
> >>
> >>ViewLeft
> >>  vtkMath::Cross(m_ViewNormal,m_ViewUp,view_normal);
> >>  camera->SetViewUp(m_ViewUp);
> >>  camera->SetViewPlaneNormal(view_normal);
> >>  m_Renderer->ResetCamera();
> >>
> >>and so on...
> >>
> >>But SetViewPlaneNormal() no longer work and I don't know
> >>how to replace the old code.
> >>
> >>Jan
> >>--
> >>-----------------------
> >>Jan Ehrhardt
> >>mailto:ehrhardt at medinf.mu-luebeck.de
> >>-----------------------
> >>
> >
> >
> >_______________________________________________
> >This is the private VTK discussion list.
> >Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
> >Follow this link to subscribe/unsubscribe:
> >http://public.kitware.com/mailman/listinfo/vtkusers
> >
> >
>
>




More information about the vtkusers mailing list