POV-Ray : Newsgroups : povray.general : "Wrapping" an image around a sphere Server Time
31 Oct 2024 10:20:41 EDT (-0400)
  "Wrapping" an image around a sphere (Message 1 to 6 of 6)  
From: Tail Kinker
Subject: "Wrapping" an image around a sphere
Date: 27 Oct 2005 00:05:21
Message: <pan.2005.10.27.04.13.22.298504@contrabandent.com>
I'd like to take a map of a planet and wrap it around a sphere.  I thought
that perhaps the image_map texture was the way to go, but nope - it
doesn't work the way I thought.  (Shoulda read the manual...it works
*exactly* as advertised.)

Any ideas on how to handle such a hack?  The map is in Mercator's
projection.

-- 
ICQ#66022322       http://tailkinker.contrabandent.com
    Worker bees can leave  
  Even Drones can fly away  
The Queen is their slave


Post a reply to this message

From: Mike Williams
Subject: Re: "Wrapping" an image around a sphere
Date: 27 Oct 2005 01:48:31
Message: <pxu5zCAnoGYDFwRx@econym.demon.co.uk>
Wasn't it Tail Kinker who wrote:
>I'd like to take a map of a planet and wrap it around a sphere.  I thought
>that perhaps the image_map texture was the way to go, but nope - it
>doesn't work the way I thought.  (Shoulda read the manual...it works
>*exactly* as advertised.)
>
>Any ideas on how to handle such a hack?  The map is in Mercator's
>projection.

Yes, it's a bit confusing that what POV calls "spherical mapping" is
what cartographers call the "cylindrical projection". If you want areas
near the poles to look right, you have to use some external tool to
convert your map from Mercator to cylindrical projection. I don't know
of any tricks within POV itself that can perform the change of
projection for you.

All the methods of wrapping an image map round a sphere use the same
"cylindrical projection" method:

sphere {0,1
  texture {pigment {image_map{ png "world.png" map_type 1} } }
}

sphere {0,1
  texture {uv_mapping pigment {image_map{ png "world.png"} } }
}

sphere {0,1
  texture {pigment {image_map{ png "world.png"} warp {spherical}} }
}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Sebastian H 
Subject: Re: "Wrapping" an image around a sphere
Date: 27 Oct 2005 04:21:04
Message: <43608df0$1@news.povray.org>
Mike Williams wrote:
> Wasn't it Tail Kinker who wrote:
> 
>>I'd like to take a map of a planet and wrap it around a sphere.  I thought
>>that perhaps the image_map texture was the way to go, but nope - it
>>doesn't work the way I thought.  (Shoulda read the manual...it works
>>*exactly* as advertised.)
>>
>>Any ideas on how to handle such a hack?  The map is in Mercator's
>>projection.

> All the methods of wrapping an image map round a sphere use the same
> "cylindrical projection" method:
> 

This mean the image x/y-Coordinates are not
interpreted as theta/phi in spherical coordinates?
I always thought it would work this way.

Please correct me if I'm wrong.

Sebastian


Post a reply to this message

From: Tim Cook
Subject: Re: "Wrapping" an image around a sphere
Date: 27 Oct 2005 04:24:45
Message: <43608ecd$1@news.povray.org>
Tail Kinker wrote:
> Any ideas on how to handle such a hack?  The map is in Mercator's
> projection.

Huh?!...ah, whew.  The NASA Blue Marble datasets are in cylindrical 
projection, I'm safe.

-- 
Tim Cook
http://home.bellsouth.net/p/PWP-empyrean

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GFA dpu- s: a?-- C++(++++) U P? L E--- W++(+++)>$
N++ o? K- w(+) O? M-(--) V? PS+(+++) PE(--) Y(--)
PGP-(--) t* 5++>+++++ X+ R* tv+ b++(+++) DI
D++(---) G(++) e*>++ h+ !r--- !y--
------END GEEK CODE BLOCK------


Post a reply to this message

From: Mike Williams
Subject: Re: "Wrapping" an image around a sphere
Date: 27 Oct 2005 04:50:33
Message: <Qu6H0DA2RJYDFwHj@econym.demon.co.uk>
Wasn't it Sebastian H. who wrote:
>Mike Williams wrote:
>> Wasn't it Tail Kinker who wrote:
>> 
>>>I'd like to take a map of a planet and wrap it around a sphere.  I thought
>>>that perhaps the image_map texture was the way to go, but nope - it
>>>doesn't work the way I thought.  (Shoulda read the manual...it works
>>>*exactly* as advertised.)
>>>
>>>Any ideas on how to handle such a hack?  The map is in Mercator's
>>>projection.
>
>> All the methods of wrapping an image map round a sphere use the same
>> "cylindrical projection" method:
>> 
>
>This mean the image x/y-Coordinates are not
>interpreted as theta/phi in spherical coordinates?
>I always thought it would work this way.
>
>Please correct me if I'm wrong.
>
>Sebastian

That how it works in all those types of POV spherical mapping, and in
what cartographers call the "cylindrical projection", but not in the
Mercator projection. 

In the Mercator projection, the lines of latitude are spaced further
apart near the poles.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Mike Williams
Subject: Re: "Wrapping" an image around a sphere
Date: 27 Oct 2005 05:08:19
Message: <fv671AA2jJYDFwG+@econym.demon.co.uk>
I managed to find an easy tweak that looks pretty good at mapping a
Mercator map onto a sphere. I've no idea if the mathematics are actually
accurate, but I can't see any errors visually.

Simply scale down the sphere by a factor of 2/3, then apply the Mercator
map, then scale it back up again.

#declare S=2/3;
sphere {0,3
  scale <1,S,1>
  texture {pigment {image_map{ png "world.png" map_type 1} }}
  scale <1,1/S,1>
}

The Mercator image I've been testing with has lines of latitude drawn on
it every 30 degrees, and these test points hit those lines exactly.

sphere {-z*3,0.05  pigment {rgb 1}  rotate -x*60}
sphere {-z*3,0.05  pigment {rgb 1}  rotate -x*30}
sphere {-z*3,0.05  pigment {rgb 1}  rotate x*0}
sphere {-z*3,0.05  pigment {rgb 1}  rotate x*30}
sphere {-z*3,0.05  pigment {rgb 1}  rotate x*60}

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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