prev index next 
Miscellaneous, Odds & Ends 
 POV-Ray Tips, 
 Tricks, and Techniques
How to Relate Resolution and Units? 
 
Somebody cannot get the correct aspect ratio: I read through the POV-Ray doc for the above subject matter, but can't seem to be able to find any reference to it. Initially I thought creating a sphere a .5 unit radius located at <0,0,0> and the camera location at <0,0,-2> looking at <0,0,0> rendering at a 1x1 ratio for height and width say at 240x240 would result in a perfect sphere with the correct aspect ratio.

Unfortunately, it doesn't. It seems using a 3x4 (height x width) ratio seems to maintain the correct aspect ratio. Can anyone point me to any documentation which I should get other than the included file in the POV-Ray distribution for a newcomer like me?
 

Dave Grossman uses this technique:
This is a camera setup I usually use. The formulas will calculate the required direction vector so that the horizontal resolution represents 'Width' in POV-Ray space.

Most full screen resolution aspect ratios are 4/3 and should be multiplied by the 'right' vector.

#declare CameraLocation = < 50,50,200 >
#declare Width = 10
#declare LookAt = < 0,0,0 >
#declare Aspect_ratio = 4/3

#declare Dist = vlength( CameraLocation )

camera
  {
    location CameraLocation
    direction Aspect_ratio * Dist/Width * y
    up y
    right -Aspect_ratio*x
    look_at LookAt
  }
 

  1