POV-Ray : Newsgroups : povray.programming : Panoramic (as in Zork Nemesis etc) : Re: Panoramic (as in Zork Nemesis etc) Server Time
29 Jul 2024 06:17:11 EDT (-0400)
  Re: Panoramic (as in Zork Nemesis etc)  
From: Chris Colefax
Date: 14 Jun 1998 10:10:09
Message: <3583D9C1.E148BC72@geocities.com>
A Ratcliffe wrote:
> 
> I'm writing a game computer game which involves the player being able to
> look round his location 360 degrees. I've been experimenting with panoramic
> on the camera for this effect, but it doesn't seem to be working. The screen
> resolution when the player is looking round is 640 x 480, truecolour. What
> settings should I set for my camera (image size, angle, etc to get the 360
> view that I require. I would think that aspect ratio would come into it, but
> I couldn't find an aspect option in the camera setup)

There are a variety of ways to do what you want; you could try the
cylindrical camera to get a full 360-degree view, eg:

   camera {location <0, 0, 0> look_at <0, 0, 1>
      right x up y cylinder 1 angle 360}

which you can rotate/translate to get the desired view of your scene.

Regarding aspect ratios - in the above case, the ratio is 2 * pi (the
circumference of the cylinder) to 1, which works out to a  3016x480
image!  One option might be to use a lower resolution with a letterbox
format (black space above and below the image).

Alternatively, you can increase the size of the up vector in the camera,
to show more of the scene vertically, eg. up y * pi works out to a 2:1
ratio, which you could render as a 1000x500 image (to allow for a little
vertical movement, as well as the left-right navigation).  You can
increase this as far as you like, but the larger the value the larger
the distortion at the top and bottom of the image.

You can get around this, and render a 360-degree view horizontally and
vertically to give a spherical projection of your scene, using the
panoramic camera, eg:

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

Unfortunately, the panoramic camera doesn't allow for viewing angles
over 180-degrees (a possible bug, perhaps?), so you will need to render
the scene once (with an aspect ratio of 1:1, eg. 600x600), and then
rotate the camera by y * 180, and render to another image of the same
resolution.  You can then join the two images side-by-side, and view
them spherically (ie. as if they were mapped to a globe).


Post a reply to this message

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