POV-Ray : Newsgroups : povray.newusers : sphere proportions : Re: sphere proportions Server Time
21 Jun 2024 00:44:51 EDT (-0400)
  Re: sphere proportions  
From: Bald Eagle
Date: 1 Jun 2021 16:55:00
Message: <web.60b69e55dfb9240b1f9dae3025979125@news.povray.org>
"Psnarf" <nomail@nomail> wrote:
> The code for demo.pov:
> #include "colors.inc"    // The include files contain
> #include "stones.inc"    // pre-defined scene elements
> camera {
>     location <0, 2, -3>
>     look_at  <0, 1,  2>
> }
> sphere {
>     <0, 1, 2>, 2
>     texture {
>         pigment { color Yellow }
>     }
> }
> light_source { <2, 4, -3> color White}
> -=-=-=-=-=-=-=-=-
> Why does the radius of the sphere change if the render window is not 1:1.333?
> A ratio of 1:1.777 (16/9) produces the attached image.

I don't think it's the "render window", but rather the camera configuration
which is the controlling factor.  In the same way that you can scale the sphere,
you can scale the camera.  Depending on the aspect ratio of the image, you're
going to need to compensate for that in some way - the easiest being the camera.

If you look at the diagram of the camera, you get a "viewport" with "uv
coordinates" of the image going from -0.5 to 0.5 both vertically and
horizontally, or one unit in each orthogonal direction.  If those are not
equally subdivided into the same number of pixels per unit, then when you try to
draw a circle, you get an ellipse.   When you try to draw a square, you get a
rectangle.  So when the image aspect tries to "pull" in one direction, you
"squash" it the same relative amount in the other so that it all balances out.

Believe, me, we've covered this very topic from a variety of angles, and if
you're intensely interested, I can point you to a number of threads, and you can
try to do some experiments of your own to demonstrate to yourself how it all



While not "POV-Ray", I personally find it instructive to learn how people code
pixel shaders from scratch, which gives me a lot of easily-accessible insight
into how things like cameras, light, shadows, transform matrices, pattern
functions, mathematical object primitives, and CSG operations work "under the



Post a reply to this message

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