POV-Ray : Newsgroups : povray.programming : A few ideas : Re: Spherical camera Server Time
29 Jul 2024 06:28:58 EDT (-0400)
  Re: Spherical camera  
From: Chris Colefax
Date: 14 Jun 1998 10:34:23
Message: <3583DF6F.5E8F9A5D@geocities.com>
The last time this query came up (on comp.graphics.rendering.raytracing)
I suggested using a cylindrical type 1 camera, which allows a 360-degree
view horizontally.  Unfortunately, though, it does not allow you to see
the points directly above and below the camera, and the larger the
vertical viewing angle, the larger the distortion.  However, while
answering another question in this group, I tried the panoramic camera
(an obvious choice, surely!), and found that it does indeed allow you to
view the points above and below the camera.

Unfortunately, the camera does not properly render angles over 180
degrees (possibly the same bug as Roland pointed out with the
ultra_wide_angle?).  This problem can be quite easily overcome by first
rendering the image with the desired camera:

   camera {location <0, 0, 0> look_at <0, 0, 1>
      right x up y panoramic angle 180}

at a 1:1 ratio, and then rotating the camera by y*180 and rendering to a
second image of the same size.  When the two images are combined
side-by-side you should have the perfect image_map for a sphere.  In
fact, I tried mapping an quick test scene to a semitransparent sphere in
front of the original scene, and all objects seemed to correlate very
well, with no distortion (even at the poles).

------------

Mike Hough wrote:
> 
> 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.
> 
[snip]
> 
> 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.


Post a reply to this message

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