POV-Ray : Newsgroups : povray.newusers : Understanding image maps on spheres : Understanding image maps on spheres Server Time
31 Jul 2024 04:20:26 EDT (-0400)
  Understanding image maps on spheres  
From: jbbarnes
Date: 30 Dec 2002 05:47:13
Message: <3e102431$1@news.povray.org>
Could someone explain to me how flat images are mapped onto spheres so I can
better manipulate them?

Here is an example of what I am working on:
http://www.geocities.com/jbbarnes77/fictionbannerfull.jpg I'm creating
glass-looking spheres that seem to have pictures inside them. The problem is
that I am having a really hard time getting the images aligned properly for
the camera. Tiling images are not too much of a problem, but let's say I
have an image of a man sitting in a chair and I want him in the dead center
of the sphere. I can set the image size and then play around with rotate
statements, but it's all guesswork because I don't understand the logic
behind the mapping process. I've learned that if I simply rotate the sphere
itself after the image is mapped, I get undesirable effects because only
looking dead-on gives a flat image. From other directions the image is
stretched and distorted. So I need to rotate the image as it is placed on
the sphere. But the x, y, and z don't work as I expect them to. Maybe I
should be using something other than rotate commands.

Here's the definition of the rightmost sphere in the above picture:

sphere { <68, 0, 50>, 10
   pigment {
      image_map { jpeg "nebula.jpg" interpolate 2 }
      scale 20
      rotate 60*z
      rotate -3*x
      rotate 6*y
    }
   finish {
      ambient 0.55
      diffuse 0.7
      phong 1
      phong_size 100
      reflection 0.505
   }
}

This was the closest I could get to making the nebula the right size and
getting it centered, but it's still not quite right. Can someone help me out
so that, once I scale the image correctly, I can understand how to center
the portion I want. Just rotating by x and y does not move it horizontally
and vertically like I had hoped.

Thanks.


Post a reply to this message

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