[vtkusers] camera follower in 3D

Miroslav Drahos mdrahos at aurisrobotics.com
Fri Mar 25 19:49:24 EDT 2016


It uses vtkFollower (a subclass of vtkActor that always faces the camera). So make sure to check out vtkFollower as well.

Miro



From: Miroslav Drahos
Sent: Friday, March 25, 2016 4:45 PM
To: 'Richard Frank' <rickfrank at me.com>; vtkusers at vtk.org
Subject: RE: [vtkusers] camera follower in 3D

Rick,
Look at vtkOrientedPolygonalHandleRepresentation3D
 http://www.vtk.org/doc/nightly/html/classvtkOrientedPolygonalHandleRepresentation3D.html
It does exactly that - keeps the widget rep (polydata) in a fixed orientation with respect to camera.
HTH,
Miro


From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Richard Frank
Sent: Friday, March 25, 2016 4:41 PM
To: vtkusers at vtk.org<mailto:vtkusers at vtk.org>
Subject: [vtkusers] camera follower in 3D


Hi,

Has anyone successfully created a widget or other object that stays facing the camera in 3D?

I've been trying to get the boxwidget to stay with one side facing the camera and I've come close - by computing a change of basis matrix after computing the camera position, direction of projection, etc. and creating a rotation matrix from the basis column vectors.

When I have the PlusX face of the box widget facing the camera, and move the camera with the trackball interactor, the face of the widget stays facing (seems like it is standing still) but the size/scale of the box gets smaller as I rotate by sliding the mouse from right to left.

It seems that I need to compensate for some scaling of the rotation matrix but I'm not sure exactly what. I'm putting together a small example if someone wants to take a look at it.

Thanks

Rick

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160325/0f9e8105/attachment.html>


More information about the vtkusers mailing list