|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
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
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Chris Amshey wrote:
>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)
>
Err, that should be 2*D*tan(CameraAngle/2), actually, so I guess my trig
skills
are totally miserable (but at least I found my own error...)
--Chris
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Chris Amshey wrote:
>Chris Amshey wrote:
>
>>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)
>>
>Err, that should be 2*D*tan(CameraAngle/2), actually, so I guess my trig
>skills
>are totally miserable (but at least I found my own error...)
Thanks for responding.
The POV Ray 3.1 docs did not give the camera angle.
I had a look at the POV 3.5 docs and found the algorithm:
direction_length=0.5*right_length/tan(angle/2)
which works.
Thanks for pointing me in the right direction.
Cheers
Eddie
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |