POV-Ray : Newsgroups : povray.general : Re: how to model a camera using pov ray : Re: how to model a camera using pov ray Server Time
5 Aug 2024 04:20:04 EDT (-0400)
  Re: how to model a camera using pov ray  
From: TinCanMan
Date: 6 Dec 2002 15:22:40
Message: <3df10710@news.povray.org>
> I'm trying to use POV Ray to simulate an image capture from a real camera.
> For example,  if my camera has a resolution of 512x480 pixels.  Where the
> horizonal pixel resolution is 0.01mm/pixel and the vertical pixel
> resolution is 0.013mm/pixel.  The focal length of the camera is 25mm.  The
> position of the camera is specified using the right hand rule with
> counterclockwise rotations as positive rotations.
>
> My problem is that when I render the image, the projection of the object
is
> not where I expected them to be.
>
> Below is the code that I made to defined the camera.  All I want to know
is
> if this way of defining the camera makes sense.
>
> #declare resolution_x = 0.010000;
> #declare resolution_y = 0.013000;
> #declare size_width = 512;
> #declare size_height = 480;
> #declare focal_length =  25.079910;
> #declare aperture_value = 25.000000;
> #declare fov_angle =  11.6934;
>
> #declare camera_position = <0, 100, 0>;
> #declare viewing_direction =   <0, -1, 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
>
>
> }

I'm not sure what you are doing wrong exactly, but perhaps you are
misinterpreting what's going on
First off, 'look_at' is the point the camera should be looking at rather
than viewing direction as you are calling it, maybe just bad terminology on
your part.

You camera declaration is fine (I would have POV calculate fov_angle though,
'#declare fov_angle =
degrees(2*atan2(size_width*resolution_x/2,aperture_value))' )

As far as I calculate, for your scene, <1,0,0> should be at <230,240>

dx = 5.12
1/2dx = 2.56
@4x distance (100=4x25):
1/2dx=10.24
pix res = 2(10.24)/512 = 0.04 /pix
point <1,0,0> projected = 1/0.04 = 25 pix
512/2-25-1 = 230

-tgq


Post a reply to this message

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