How to map a plane to a 3d sphere?

Started by
10 comments, last by legolas558 18 years ago
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,
- k2"Choose a job you love, and you'll never have to work a day in your life." — Confucius"Logic will get you from A to B. Imagination will get you everywhere." — Albert Einstein"Money is the most egalitarian force in society. It confers power on whoever holds it." — Roger Starr{General Programming Forum FAQ} | {Blog/Journal} | {[email=kkaitan at gmail dot com]e-mail me[/email]} | {excellent webhosting}
Advertisement
Quote:Original post by kSquared
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.

Since the rendered sphere will be small and a sort of preview, I am ready to make such compromises.
Quote:Original post by kSquared
To get altitude, simply note the altitude that P would have had were it not flat. Then give S the same altitude.

My solution was to move the S point by its altitude following the radial versor. This is not precise, since I would have to recalculate altitude considering the new plane of the transformed vertices and keeping my peak orthogonal to it.

Thank you for your comments!

This topic is closed to new replies.

Advertisement