POV-Ray : Newsgroups : povray.general : Wrapping a 360 photo around the inside of a sphere : Re: Wrapping a 360 photo around the inside of a sphere Server Time
1 Aug 2024 20:10:08 EDT (-0400)
  Re: Wrapping a 360 photo around the inside of a sphere  
From: Mike Williams
Date: 7 May 2005 08:37:47
Message: <b8DlgBAPaLfCFw63@econym.demon.co.uk>
Wasn't it Rick Measham who wrote:
>Over at http://www.plattenhof.com/ehtml/index.html, if you go to virtual 
>tour you can get a whole pile of 360 degree photos, taken for use in 
>quicktime VR presentations.
>
>It struck me that it should be possible to image_map these onto the 
>inside of a sphere in POVRay and be able to view them just like in QTVR.
>
>The following is my quick-scene test. It doesn't work and produces 
>horribly distorted pictures. I'm sure I'm missing something simple!
>
>Learned ones, am I just crazy thinking I should be able to do this?
>
>I'm convinced the pictures are 360 degrees left-to-right, but I don't 
>think they're complete top-to-bottom, so I probably need to adjust my 
>scale a bit to compensate.

One way to do the compensation is to modify the image. Add about 56
pixels to the top edge and about 46 to the bottom edge, giving an image
that's 1000x500. Obviously you're not going to be able to fill those
strips with the correct textures, so you're going to get circles on your
floor and ceiling without the proper texture, but it makes the geometry
of everything else work out correctly.

Then do something like:
camera {
   location  <0, 0,0>
   look_at   <0,0,50>
   angle 100
   //rotate -90*x
}

sphere {
   0, 50
   pigment {
      image_map {jpeg "360_lobby2.jpg"
         map_type 1
         interpolate 2 
      }
      scale <-1,1,1>
   }
   finish { ambient 0.9 }
}

Apply camera rotation -90*x or +90*x to see the blank circles on floor
and ceiling.

"map_type 1" is spherical image mapping. It would automatically perform
the scaling you suggested if you use the 1000*398 image, but then the
geometry gets a bit distorted.

"interpolate 2" improves the result at points that map between pixels of
the original image.

"scale <-1,1,1>" flips it the right way round for being viewed from
inside the sphere.


-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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