POV-Ray : Newsgroups : povray.newusers : Image mapping onto shere : Re: Image mapping onto shere Server Time
7 Jul 2024 08:35:02 EDT (-0400)
  Re: Image mapping onto shere  
From: geogeo
Date: 21 Jan 2010 10:55:00
Message: <web.4b5878a558ffb9ec846dd2f80@news.povray.org>
"Tim Attwood" <tim### [at] anti-spamcomcastnet> wrote:
> Spheres are supported by UV mapping,
> so...
>
> sphere {0,1 pigment {
>    uv_mapping
>    image_map {jpeg "lines3.jpg"}
> }}
>
> should work fine. In the more general case
> (since not all objects are supported by UV mapping),
>
> sphere {0,1 pigment {
>    image_map {
>       jpeg "lines3.jpg"
>       once // don't repeat the image
>       map_type 2 // cylindrical
>    }
>    translate <0,-0.5,0> // center the image on origin
>    scale <1,2,1> // double the height to match diameter of sphere
> }}
>
> All this assumes that your starting image is a cylindrical
> map. When you are looking at a cylindrical map there is
> distortion near the top and bottom of the image, this means
> that to do vertical lines, they are no longer straight, but hourglass
> shaped in the source image, otherwise the lines will pinch in
> narrower at the poles. So they're a bit hard to manually create
> in a paint program, but such images are available online for the
> earth and most of the planets.

Many thanks, works fine! I already had a suitable POVray cylinder image for
Earth but hadn't twigged the uv-mapping aspect. From a few tests I've done it
seems the aspect ratio of the image is not important - it gets stretched to
cover the sphere. Very handy.

Thanks again
Geo


Post a reply to this message

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