POV-Ray : Newsgroups : povray.advanced-users : camera distance question : Re: camera distance question Server Time
30 Jul 2024 02:23:57 EDT (-0400)
  Re: camera distance question  
From: Mike Williams
Date: 17 Jun 2000 15:36:22
Message: <$5EUzEAdy7S5Ew4D@econym.demon.co.uk>
Wasn't it Steve Strickland who wrote:
>I'm writing a C++ application that outputs POV-Ray scripts of geometric
>puzzles. The puzzles come in all concieveble sizes, tiny to humongous.
>
>What I'm trying to do is calculate the location of the camera based on
>the size of the object so that the object fills the view. I intend to
>leave the camera angle set at 50 all the time.
>
>Does anybody know the equation for this?


If you're using an image with the default (4:3) aspect ratio, and call
the height of your object H and the width W. 

You need to position the camera H/(2*tan(degrees(50)) away to get it to
just fit vertically.
You need to position the camera (3/4)*W/(2*tan(degrees(50))) to get it
to just fit horizontally.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.