POV-Ray : Newsgroups : povray.newusers : Question about Camera Geometry : Re: Question about Camera Geometry Server Time
28 Jul 2024 16:24:01 EDT (-0400)
  Re: Question about Camera Geometry  
From: alphaQuad
Date: 17 Jul 2008 19:45:01
Message: <web.487fd902d14244a66d912ba0@news.povray.org>
"callendorph" <cal### [at] esolarcom> wrote:

> ... Now the thing I am having trouble understanding is
> how to convert this image plane into width and height of the image in Povray
> standard units. From this I should be able to use the resolution to calculate
> how big a pixel is in terms of these "Povray units." Does this make sense?
> Does the right and up vector actually control the size of this image plane?

I think this will help, I can calc the points on the xy screen, by understanding
a sin law and world to screen transformation.

there are 9000 stars in the catalog, do i set up all stars or just the ones in
frame. All of them If I cant calc the frame. This is where invertmatrix must be
used

//cx and cy are center screen
//focal length
#macro FOL(a)
  #local L = radians((180 - a) / 2);
  #local L = asa_sin(pi/2,cx,L);
  L
#end
#macro world2screen(_v,fol)
  #local s = <int((fol / _v.z) *_v.x), int((fol / _v.z) * _v.y)>;
  s
#end

where worldmatrix is cameramatrix inverted

#local ab = pop_matrix4(worldmatrix,_v);
    #if ((ab.z > 0.0) | BackStars)
      #local av = world2screen(ab,FOL(camang));    //faster rendering than
adding 640.512 in w2screen
      #if (((av.x < cx) & (av.x > -cx) & (av.y < cy) & (av.y > -cy)) |
BackStars)

av.x and av.y are screen points
see pov planetarium for full code
http://home.earthlink.net/~openuniverse/

here is camera proof. left image is a 1.25 aspect ratio and the right image
1.333333. notice lower right corner. width fov is same. and both have round
circles 1to1 drawn around rendered earth by paint program.

oops I'll to post in images
aQ


Post a reply to this message

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