POV-Ray : Newsgroups : povray.advanced-users : stereographic projection : Re: stereographic projection Server Time
5 Jul 2024 16:37:07 EDT (-0400)
  Re: stereographic projection  
From: Trevor G Quayle
Date: 8 Feb 2008 09:00:01
Message: <web.47ac5f5e8ae02ef3c150d4c10@news.povray.org>
"Mark Weyer" <nomail@nomail> wrote:
> > > > #declare R=1;//Radius of projected sphere
> > > > #declare d=2;//distance from center of sphere
> > > > camera {
> > > >   user_defined
> > > >   location{
> > > >     function{(u-1/2)*2*(R+d)}
> > > >     function{d}
> > > >     function{(v-1/2)*2*(R+d)}
> > > >   }
> > > >   direction{
> > > >     function{-(u-1/2)*2}
> > > >     function{-1}
> > > >     function{-(v-1/2)*2}
> > > >   }
> > > > }
>
> Consider the following:
>
>   camera {
>     location -R*y
>     direction y
>     right -2*x
>     up -2*z
>   }
>
> If I understand syntax correctly, this should be equivalent to
>
>   camera
>     user_defined
>     location {function {0} function {-R*y} function {0}}
>     direction {
>       function {(u-1/2)*-2}
>       function {-1}
>       function {(v-1/2)*-2}
>     }
>   }
>
> Now, assuming I made no mistake, the second camera is a shorthand for the
> third one. The directions in the first and third are equal. The locations
> are not equal, but, by your argument cited below, they differ only by a
> factor (R+d) of the respective direction.
>


There is a big difference between the locations.  u and v represent the location
in the image, so with the first one, each u/v gives a different location,
essentially each position on the image plane, the view then *converges* from
the image plane to the south pole, passing through the equator.
In the third one, the location does not vary with u/v, so it is a static
viewpoint (such as a standard camera), the direction vectors still correspond
to the converging vectors, but because they are coming from a point, they
essentially diverge, albeit in the negative directions that they should.

So: the first camera looks from outside the scene inwards, the third camera
looks from inside the scene outwards.  Now it depends on how you want to use
the projection.  If it is merely the mapping of a sphere surface and pattern,
then looking in to out works, but if you have, for example, created a small
planet with forests/buildings/lakes/etc, then you more likely want to view it
from the outside in.

Another diffence is that in the first camera, whatever is located at the look-at
point will be seen as a singularity that fills the whole image if visible.  In
the second camera, this situation would be equal to an object placed at the
location point, however the camera would be inside or coincident with it.

Also, the second is not equal to the third one.  In the second one the direction
is given as +y, in the thrid, the equivivalent direction is -y.  The locatio,
right and up values are equal though.  The two cameras look in opposite
directions.


> Now assume, that nothing is between the two version of location, in
> particular no media and no fog. Then the first and third camera give the
> same result. As the second is a shorthand for this, we may conclude that
> your camera is equivalent to a standard perspective camera. (Up to nothing
> beeing in between the different locations.) This is not intended for
> stereographic projection.
>

You are right, when I look at it, it is essentially equal to a perspective
camera (except inside out, which isn't possible with a regular camera except by
using refractive lenses).  But this is exactly how I understood it from
wikipedia, each ray passes from the opposite pole, straight through the sphere
surface, onto the projection plane.  To me it appears that is supposed to be
exactly equale to a perspective projection (with a 90deg viewing angle), but
that it is traditionally meant as a means of projecting a spherical surface
onto a flat surface.  We are thinking of it as 3d objects rather than 2
surfaces which I think confuses the matter in our interpretation.


-tgq


Post a reply to this message

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