Skip to main content
GameDev.net gamedev.net
🔒 Locked

Spherical Texturing

Started by angelhernandez Mar 9, 2009 at 12:53 PM 0 replies 700+ views
Original Post
angelhernandez
angelhernandez
Hi, I'm using D3DXCreateSphere to create a sphere, and I want to texture that sphere. I'm using the formula tu=asinf(normal.x)/D3DX_PI+0.5f; tv=asinf(normal.y)/D3DX_PI+0.5f; to texture the Sphere, but it shows the texture twice on the sphere, one on the front and one on the back, and I want it to completely texture the sphere only once. So my question what is the formula to texture the sphere all around once. For example, Create a sphere globe and texturing it with a world map texture.
jollyjeffers
jollyjeffers
Spherical mapping is unfortunately non-trivial. Try wrapping a piece of paper around a tennis ball for example [smile]

You'll almost certainly have to deal with some sort of distortion - either as compression at the poles, or as unused texels in the source texture.

I don't have any links to hand (only ever seen it discussed in books) but there should be a bunch of papers/articles on various spherical mapping algorithms available via your favourite search engine.


hth
Jack
<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ |

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.