Sign in to follow this  
Beren77

Map texture "manually" to a sphere

Recommended Posts

Beren77    133
Hi,

I am writing a 2D game. Well. Mostly. All of the graphics are 2D, but I'd like to have a "ball" to roll around. Now, so far, I am content with SOL's solution in the SOL tutorials (projecting polar coordinates to the 2D surface). But I'd rather like to apply a texture to the ball.
So, the easy question is: How can I map a texture to a "circle" (well, a sphere, alright, but so far, I did not compute any normal vectors -- how could I achieve this? Do I need normal vectors for this?).

Where can I find a good example of sphere-texture-mapping? I googled, of course, but maybe I am looking for the wrong keys, because I _can_ find how to map a texture to "vertices" -- which, so far I don't have...

Am I talking gibberish again or can you actually follow my weird thoughts?! :)

Just ask for specifics, and I'll try to clarify; if you have a solution to my problem (or know where I have to look), I'd be thankful if you could help me!
Thanks!
Beren

Share this post


Link to post
Share on other sites
ApochPiQ    23005
If I understand you correctly, I think what you're after is a [url="http://en.wikipedia.org/wiki/Map_projection"]map projection[/url]. There are a number of different projection algorithms out there, the linked article should be enough to get you started :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this