POV-Ray : Newsgroups : povray.general : Need to change aspect ratio, how ? : Re: Need to change aspect ratio, how ? Server Time
9 Aug 2024 03:22:28 EDT (-0400)
  Re: Need to change aspect ratio, how ?  
From: Pete
Date: 27 Aug 2000 11:27:12
Message: <1299.274T2208T6284965PeterC@nym.alias.net>
Assuming square pixels, aspect ratio for any image size
can be specified entirely in the "right" command in the camera
object (as long as you keep the "up" command at value of one).

 ... for example ...

#declare horizontal_aspect = 16;
#declare vertical_aspect = 9;

camera {
  location <0, 0, 0>
  direction <0, 0, 1>  // off-topic note: increase this to "zoom" in
  right <horizontal_aspect / vertical_aspect, 0, 0>
  up <0, 1, 0>
  // put look_at or rotate & translate statements here
}


        You can always just use the size of the image, as
in ....

  right <640 / 480 , 0, 0>
  up <0, 1, 0>

        Also: I find it easier to use the output image dimensions
for the horizontal_aspect and vertical_aspect values.  Since we
are dealing with a ratio, we can choose our units of measurement
arbitrarily.
        For example, one time I was rendering an image at to be
printed on an 11" x 8.5" peice of paper.  With margins, that ended
up as an image size of 10.5" x 8".  So:

  right <10.5 / 8, 0, 0>


        For non-square pixels (as in an Amiga at an ntsc display
mode), simply multiply by the actual aspect of a pixel.  Since
an Amiga ntsc pixel is 10:11, do this for a 640 x 400 image:

  right <(640 / 400) * (10/11), 0, 0>

        took me YEARS to figure that last bit out.


Post a reply to this message

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