[vtkusers] How to set camera so that the image fill up the screen horizontally

David Gobbi david.gobbi at gmail.com
Wed Mar 9 13:16:28 EST 2011


On Wed, Mar 9, 2011 at 10:57 AM, chrisyeshi <chrisyeshi at gmail.com> wrote:
> Thanks for your reply, it's alot clearer now!
>
> So, for perspective, it's better to SetViewAngle rather than calculating the
> camera distance?

That's up to you.  I use a parallel projection when viewing images.  But if you
want to keep the perspective constant, then you should keep the ViewAngle
the same and modify the Distance.

> By the way, how to determine the camera distance? Right now I am just using
> bounding box radius * 2.

Compute the distance from your ViewAngle and your image height.  The equation
is something like  Height*0.5/Distance = tan(0.5*ViewAngle)

 - David



More information about the vtkusers mailing list