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
|