POV-Ray : Newsgroups : povray.newusers : Model a real world camera Server Time
29 Jul 2024 18:30:09 EDT (-0400)
  Model a real world camera (Message 1 to 2 of 2)  
From: Alblurrow
Subject: Model a real world camera
Date: 24 Jul 2005 06:26:01
Message: <42e36cb9@news.povray.org>
Hello,

I'm new to PovRay, and I'm using it to create some test images for a robot
localization problem. I want to model the camera the robot has. I've
searched the newsgroups and googled but I haven't found the right way to do
it. 

As you cannot specify the focal lenth of the camera it has to be done
through the other parameters.

This is what I've written but it doesn't work:

#declare size_width = 768;
#declare size_height = 576;
#declare ccd_w = 2.7;
#declare ccd_h = 3.6;

#declare resolution_x = ccd_w / size_width;
#declare resolution_y = ccd_h / size_height;

#declare focal_length =  3.5;
#declare fov_angle =  42.18;

#declare camera_position = <0, 5, 5>;
#declare viewing_direction =   <0, 4, 0>;

camera {
 location camera_position
 right <-size_width*resolution_x,0,0>
 up <0,-(size_height*resolution_y),0.0>
 angle         fov_angle
 look_at        viewing_direction*20
}

The FoV angle is calculated with the formula:

fov=2*atan(ccd_w/(2*f))

Any help how to do it?? Part of the code above is from another post I found
in this newsgroup...

Thank you very much!!


Post a reply to this message

From: Christoph Hormann
Subject: Re: Model a real world camera
Date: 24 Jul 2005 08:35:02
Message: <dc01p9$u89$1@chho.imagico.de>
Alblurrow wrote:
> Hello,
> 
> I'm new to PovRay, and I'm using it to create some test images for a robot
> localization problem. I want to model the camera the robot has. I've
> searched the newsgroups and googled but I haven't found the right way to do
> it. 
> 
> As you cannot specify the focal lenth of the camera it has to be done
> through the other parameters.

The focal length alone does not define the field of view of the camera. 
  To calculate the camera angle from the focal length and the sensor 
size use simple geometry - the formula you gave is correct for normal 
lenses, for others see:

http://bobatkins.com/photography/technical/field_of_view.html

> This is what I've written but it doesn't work:

'It does not work' has not much value as description of a problem.  Note 
the sensor resolution is not relvant to set up the camera in POV-Ray.  See:

http://www.povray.org/documentation/view/3.6.1/246/

for the meaning of the camera parameters.

Christoph

-- 
POV-Ray tutorials, include files, Landscape of the week:
http://www.tu-bs.de/~y0013390/ (Last updated 01 Jul. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/


Post a reply to this message

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