Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Morphing infinite texture-mapped plane into sphere


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 IncorrectBaboon   Members   -  Reputation: 103

Like
0Likes
Like

Posted 04 March 2013 - 02:43 PM

Hi,

I'm trying to come up with a program which will be able to display an infinite plane in 3D space (with a tiled texture) which will be able to morph into a spehre (with as little texture distortion as possible). Kind of like an infinitely repeating world map which can wrap up into a rotatable Earth-like sphere (doesn't need to be accurate, it's just a crude visual effect). I have only very basic knowledge of graphics theory, and am not sure where to look for algorithms which would allow me to perform such manipulations. Can anyone offer any advice as to how I might be able to form the mathematical basis for such a program?

Thanks a lot :)

(I should mention that I'm new to these forums - please let me know if what I'm asking is too vague)

Sponsor:

#2 carangil   Members   -  Reputation: 502

Like
0Likes
Like

Posted 04 March 2013 - 06:19 PM

Ok, I think I know what you want.  Unfortunately, it's a little impossible so you have to cheat.  Suppose we have a rectangular map.  When flying/walking over the map, repeating this same map over and over is easy.  The problem is there's no clean way to wrap a plane onto a sphere.  There will be a lot of distortion, especially at the poles.  http://en.wikipedia.org/wiki/Map_projection

 

What you can do, if you don't need any kind of accuracy or correctness, is cheat.   When you're close to the ground, I imagine you just draw a subrectangle of the rectangular map, just the area immediately around the player.  When you want to view the sphere at a distance, just map a circle of the map around the player onto a hemisphere.  The area in the center of the circle will look mostly correct, but near the poles will be wrong.  Instead of rotating the sphere, just change the center point.  This way you can rotate on either 'axis' and come back to where you started. 

 

Interesting enough, if your world is a donut shape, an infinitely repeating rectangular map works perfectly!



#3 IncorrectBaboon   Members   -  Reputation: 103

Like
0Likes
Like

Posted 04 March 2013 - 07:23 PM

Yes, mapping onto a hemishpere in that manner would fit the job perfectly. I couldn't have asked for a more helpful response, thank you very much :) .




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS