[vtkusers] Flip camera's view

Kevin H. Hobbs hobbsk at ohiou.edu
Fri Jul 11 05:01:58 EDT 2008


On Tuesday 08 July 2008 09:26:27 pm rashedk wrote:
> Hi all,
>
> I am trying to flip a camera's viewing direction. Basically, I want to look
> in the opposite direction.
>
> I tried negating vtkCamera's Focal Points, but this didnt work. What am i
> doing wrong?
>
> Thanks
> Rashed

It sounds to me like you should set the camera's position to the other side of 
the focal point...

double posx, posy, posz;
double fpx, fpy, fpz;
double dx, dy, dz;
camera->GetPosition( posx, posy, posz );
camera->GetFocalPoint( fpx, fpy, fpz );
dx = posx - fpx;
dy = posy - fpy;
dz = posz - fpz;
posx = fpx - dx;
posy = fpz - dy;
posz = fpz - dz;
camera->SetPosition( posx, posy, posz );

I think view up should remain the same...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080711/6ab7022c/attachment.pgp>


More information about the vtkusers mailing list