Texture Map Correction for spherical mapping

Blitz3D Forums/Blitz3D Programming/Texture Map Correction for spherical mapping

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Morbius, the commandline for this planet is exactly

planet.exe -pq -M terra.rgb -i -0.01 -s 0.1 -w 512 -h 256 -o planet.bmp

the switch -pq calculates the square projection (example 2), changing this to -pm you'll get mercator projection (example 1), oh and terra.rgb is a simple text file:

#333399
#6666cc
#009900
#E8A45A
#F8B45C
#A5806C
#FFFFFF
#000000
#000000

EDIT: here is an animation of the two maps - Morbius you're right, it seems that the map is cut off slightly at the poles in mercator projection mode. The distortion looks like if it increases from equator to poles in an exponential?!? curve:



But even if I take another map it doesn't gets seamless. I've made a small GIF animation to see the difference:



markcw, if I take your code and use the same image we can see the difference, the distortion is not strong enough:



I think we should extract the wisdom from Torbens C code because he knew how to do the trick :-|

My final pseudorandom generated world could look like this (needs more finetuning, first attempt of atmosphere):