i have an image that rendered from data i have on my DB. i need to convert this image, with Mercator Projection method, to distorted image that when i'll wrap a 3d sphere with it it'll looks realistic.
do anyone know what are the formulas i need to use to make the distorted image?
P.S. i'm using PHP with GD.
update:
in which format is your original data?
my data is saved as XML, but we'll do here some optimizations after that so save it compressed with some binary algo.
the rendering process has already done and i already have the rendered image as 2d view but without the distortion that should be in images that under Mercator Projection.
to explain more about my needs, i attached link to album 2 photos i uploaded: '2dBefore.jpg' is an example images that show how it's looks like after the data rendering but before the Mercator Projection distortion, and '2dAfter.jpg' show how the image should be looks like after the Mercator Projection distortion
as i understood, the distortion being worse as much as your going north or south from the equator and i need to know how to do that with code (and not with Gimp as i did now)
I'll also explain you generally about my project: it's a game that each user on it should locate on specific location against a planet (sphere). in the game, there are 2 modes: 1. 2d mode - that show maps on 2d view with the users' data on it. 2. 3d mode - that show a sphere with the users' data on it. it's like takes Google maps and Google earth together on the same application. when a player zoom out/in he'll pass between the modes.
i already mapped the world by longitude and latitude and each user have his own coordinate, the rendering of the data on the 2d maps (using PHP and GD) working fine (I'm consider the world like that: http://www.dsscentral.info/dishtips/world105.gif) but in the 3d map i have some hard-times to understands how i should distort it, as you probably understand from the above.