POV-Ray : Newsgroups : povray.newusers : Model a real world camera : Model a real world camera Server Time
29 Jul 2024 16:18:45 EDT (-0400)
  Model a real world camera  
From: Alblurrow
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

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