POV-Ray : Newsgroups : povray.general : "Wrapping" an image around a sphere : Re: "Wrapping" an image around a sphere Server Time
1 Aug 2024 12:23:32 EDT (-0400)
  Re: "Wrapping" an image around a sphere  
From: Mike Williams
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.