POV-Ray : Newsgroups : povray.general : Camera distance calculation : Re: Camera distance calculation Server Time
1 Aug 2024 20:14:54 EDT (-0400)
  Re: Camera distance calculation  
From: Slime
Date: 24 May 2005 20:21:18
Message: <4293c4fe$1@news.povray.org>
> I guess I mean the z value.  I wrote a custom rendered for the winamp's
AVS
> (yes I know thats horrible) that divided by true distance instead of just
> z...  However that was very long ago and I cannot remember how to set up
> the matrix the same.  More or less, it would make things based on the x
and
> y off set smaller based on the fov.

Oookay. You're kind of thinking of the scanline sort of algorithm where, for
every point of importance (such as a triangle vertex), the x and y values
are divided by the z value to get the position on screen.

Since POV-Ray is a raytracer, it works a little differently; that division
is never actually performed. Instead, the camera is defined as a mapping
from screen coordinates ((u,v) coordinates; the horizontal and vertical
position on the image) into 3D vectors (directions away from the camera
center). For each pixel in the image, that mapping is used to get the
direction in which a ray is shot into the scene, and the color the ray sees
is used for the color of the pixel.

The default perspective camera uses a mapping that creates the divide-by-z
effect that you're used to. It sounds like you want something where the
(u,v) coordinates are interpreted as angles from a central offset. Fisheye
does kind of do what you want, but it doesn't create rectangular images. I
think panoramic might do the trick, or maybe ultra_wide_angle. If all else
fails, I believe MegaPov (or maybe it was a different unofficial patch?) has
a feature where you can use functions to define the mapping mathematically,
so it should be possible to get the effect you want even if you have to code
it yourself.

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

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