[vtkusers] camera follower in 3D

Richard Frank rickfrank at me.com
Fri Mar 25 21:30:27 EDT 2016


Ok, I could never get it to work. But more specifically, I need the box/clip widget to stay perp to the camera. It is composed of many actors( which are private)

Rick Frank

> On Mar 25, 2016, at 9:19 PM, Miroslav Drahos <mdrahos at aurisrobotics.com> wrote:
> 
> Rick,
> There is no such restriction for vtkFollower. It is a vtkActor, so can be used with a variety of different data sources, such as polydata. That’s the case for example with the oriented polygonal handle representation.
> The transform that you are looking for is calculated in vtkFollower::ComputeMatrix().
> Cheers,
> Miro
>  
>  
> From: Richard Frank [mailto:rickfrank at me.com] 
> Sent: Friday, March 25, 2016 5:57 PM
> To: Miroslav Drahos <mdrahos at aurisrobotics.com>
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] camera follower in 3D
>  
> Thanks the problem I've had with VTK follower is that it seems dedicated to text- it puts text at the viewport z= 0 and doesn't seem to work for something at the camera focal point
> 
> Rick Frank
> 
> On Mar 25, 2016, at 7:49 PM, Miroslav Drahos <mdrahos at aurisrobotics.com> wrote:
> 
> 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
> 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/dc6ff814/attachment.html>


More information about the vtkusers mailing list