POV-Ray : Newsgroups : povray.newusers : Camera algorithm : Re: Camera algorithm Server Time
30 Jul 2024 22:24:55 EDT (-0400)
  Re: Camera algorithm  
From: Chris Amshey
Date: 22 Jun 2003 05:40:01
Message: <web.3ef578e6bb12258161b99e900@news.povray.org>
Eddie Lotter wrote:
>Is there an algorithm I can use to calculate how far the camera needs to be
>from an object so that the object is entirely visible?
>
>I have written a fun utility that reads an image file and converts each
>pixel to a sphere, cyclinder or box. I would like to include recommended
>camera settings such that all the objects are visible.
>
>Cheers
>Eddie
>

For a camera on the Z-axis, pointing along the Z-axis,
the edge-to-edge view at distance D should be (if my trig skills aren't
totally
miserable):
2 * D * tan(CameraAngle)

You could try 67.380 (degrees) for CameraAngle, but that's an approximation
(from the manual). Remember povray's trig functions take radians; I don't
know what your calculator takes. You'll want to read the camera section of
the manual, especially if you are going to transform your camera in any
way, and it seems to me that the x aperature and the y aperature cannot be
the same in a non-square image (at least not without distortion).

--Chris


Post a reply to this message

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