POV-Ray : Newsgroups : povray.programming : A few ideas : Re: A few ideas Server Time
29 Jul 2024 06:25:28 EDT (-0400)
  Re: A few ideas  
From: Mike Hough
Date: 4 Jun 1998 01:33:25
Message: <357631A5.815045EE@aol.com>
I tried it with the changes made to render.c.  It worked just like you said, but I
realized
that this camera type is not going to create a suitable image.  I didn't realize,
however,
that I could simply add cameras using the test camera slots.  I'll keep working on
this, as
that is very convenient for me.

I'll try to explain how an image must look in order for it to be wrapped onto a sphere
without any distortion.  It's very easy for me to visualize, but the math escapes me
(I
keep trying).  If we imagine a camera pointed at <0, 0, 1> and at the center of a
room,
what we want is for the point directly overhead to occupy the entire first row of the
image.  Same goes for the point directly below us.  The center of the image will be a
cylindrical projection of an angle perpendicular to the sky_vector and wrapping around
the
right direction.  The rest needs to have a point on an imaginary sphere (with a camera
at
the center) match a point on a rectangular screen.

The reason for the 1:2 aspect ratio is that the up only goes from -90 to 90.  It
doesn't
wrap all the way around.  The right goes all the way from -180 to 180, but we get all
the
info in the view in the image, since once the right gets to the other half of the
image, we
start getting samples of the other half of the room.  That description may sound
awful, so
I'll just say it's like slicing a sphere from pole to pole on one side and then laying
it
out on a rectangle.

 I'd try an ascii drawing, but it won't show it very good, so I uploaded an example to
my
web space(I can't upload to news.povray.org through aol for some reason).  It shows
the
effect pretty well, although the top and bottom got cut off when I rendered..  If you
put
this on a sphere in POV using a spherical mapping and put a camera inside, I think
you'll
see what I mean.  The entire image is distorted, but you can clearly see that the four
corners of the room (each a different color) are in the center of the image and that
the
top and bottom flare out at the edges.  When wrapped onto a sphere this flare squishes
together at the poles, creating an undistorted replica of the original scene.  You'll
get a
white circle on the top and bottom because the image is incomplete.

I uploaded the image as:

http://members.aol.com/amaltheaj5/panorama.html

It is nothing more than a square room with each of the four walls given a different
color,
the ceiling being White and the Floor black, all of which with a grid on them to make
the
effect more clear.  I rendered this with Ray Dream Studio, as it has a spherical
camera.
It's been a side project of mine to duplicate this in POV-Ray, hence my original post
(the
others were just ideas I never tried).

I appreciate the help you've given me so far, and I surely wouldn't mind if you
continued,
but don't go to too much trouble.  If I find a way to do it I'll definitely post the
code.
At this point I'm just pluggin away with numbers, with no real knowledge other than
scraps
of math I've picked up here and there to go on.  LOL.

-Mike






Ronald L. Parker wrote:

> On Wed, 03 Jun 1998 03:48:45 -0500, Mike Hough <POV### [at] aolcom>
> wrote:
>
> >As far as chopping off the top and bottom of the image, the tests I had done
> >didn't require that, but I used the 1:2 aspect ratio recommended for spherical
images.
>
> I'm not sure what you mean here.  If you specify a right of 2x and an
> up of z, you'll get an image suitable for mapping on an ellipsoid.  If
> you specify an image width of 600 and a height of 300, it'll still
> have the views to the rear above and below, and they'll still need to
> be chopped off to work correctly.  ASCII art below.
>
> Imagine you have a scene with two spheres, one in front and one
> behind.  Render it with ultra_wide_angle and an angle of 360*pi, and
> you'll get something like this, without the dotted horizontal lines:
>
>       \_/
>
>  - - - - - - -
>        _
> \     / \    /
>  |   |   |  |
> /     \_/    \
>
>  - - - - - - -
>        _
>       / \
>
> The sphere above and below is the same one as right and left, viewed
> by looking up or down so far you're now looking backwards, between
> your knees if you will, or bent over double with your hands behind
> your head in a crab-walk.  The image you need for mapping is the part
> between the dotted horizontal lines, which mark the zenith and nadir
> and should ideally be the same color, all the way across the image.


Post a reply to this message

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