POV-Ray: Setting output resolution or width/heigh ratio within the script

povray

Solution

This is how I do it (sorry for the late answer):

In the .pov file, specify the "up" and "right" keywords:

camera {
   up <0,9,0>
   right <16,0,0>  // right,up -> 16:9
}

Additionally, I specify height and width of the output in the .ini file:

Width=1600
Height=900

If you don't want to use .ini files, you can also specify height and width in the command line:

povray -H900 -W1600 ...

Maybe this is closer to your scripting solution.

Problem

I have a code that generates a bunch of `*.pov` files for visualization using POV-Ray. Unfortunately, they are of different aspect ratios (width/height). That information is in the script in the form of the up/right vectors. However, when I render a script without any extra parameters, i.e. through `povray test.pov`, POV-Ray forces the standard 4/3 aspect ratio. Therefore, images are distorted. Question: Is there any way that the script may request a certain aspect ratio or resolution?

Original source