Quote:Original post by legolas558
I want to turn a plane into a sphere. But things got a bit more complex when I wanted to use a 3d terrain instead of a completely flat plane.
I will work on a solution making some tests now.
This is a nontrivial problem. You must sacrifice some part of the planar representation to get it to work. Which part you feel like sacrificing (e.g. distorted perspective, non-linear lines, etc.) dictates what sorts of transformations you can use.
One simple mapping is to imagine the sphere touching an infinite (flat) plane at its south pole. Call the north pole P. Choose a point on the plane, Q, to be mapped onto the sphere. Draw a line l from P to Q. This line will intersect the sphere at some point S. This point is the mapping of Q onto the sphere. To get altitude, simply note the altitude that P would have had were it not flat. Then give S the same altitude.
Hope that helps,