POV-Ray : Newsgroups : povray.newusers : get the rays back : Re: get the rays back Server Time
29 Jul 2024 04:24:24 EDT (-0400)
  Re: get the rays back  
From: Verm
Date: 31 Jul 2006 11:07:59
Message: <44ce1ccf@news.povray.org>
zorro wrote:
> Hi everybody.
> I find POV-ray very useful to test my computer vision algorithm.
> However I don't understand how focal length works. In particular after
> rendering my image I need to get the rays back from the image pixel, or
> better, given a image pixel at coordinate (x,y) of the image, I want to
> associate to it the relevant ray that passes through the pinhole of the
> camera (namely, its 3D equation).
> 
> For my preliminary experiments I use the simply standard camera
> camera
> { location <0, 0, 0>
>   direction <0,0,-1>
> }
> 
> So I was wonder what is the value of focal length (1?), so that if I have
> the pixel in (15,12) in the image (with the origin set in the middle of the
> image) what is the equation of the ray associated to that pixel? How this is
> also related to the resolution of the image?
> 
> Thank you.
> 
> Simone

To find out about the ray you are sending all you need is
1) the field of view of the image,
2) the aspect of the image (ratio of horizontal/vertical fields of view)
3) the position in the image.

1&2 can be set by the camera definition block and are explained in the 
docs. 3 is the pixel coordinates with relation to the size of the image.

There is not really such a thing as resolution in POV.

If you have a field of view of 90 then the middle pixel (320,240 in a 
640x480 image) points straight down the z axis, and the top left pixel 
points up 45 degrees and left 45 degrees. (You just need to mess around 
with right angled triangles for the rest) Try aiming cameras at unit 
cubes on chequered planes and you'll soon get the idea.


Post a reply to this message

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