Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Textured spheres without strong distortion

I've seen well-textured balls, planets, and other spherical objects in couple of games, last time in UFO: aftermath. If you just splatter a texture into latitude/longditude as u and w -coordinates you'll get lots of ugly texture distortion to poles.

I can think myself an one way to implement a spherical map with minimum distortion. By mapping in triangles instead of squares. But I don't know any algorithms. How to produce vertices and texture coordinates for such spheres?

Also, I don't see a way to generate a complete spherical map from a simple flat square map. Is there some intuitive way on drawing such maps without real trouble?

Though, is there other algorithms to render a sphere without or with minimal distortion?

Both raytracing and rasterising algorithms are interesting.

like image 481
Cheery Avatar asked Oct 17 '08 17:10

Cheery


People also ask

How do you texture spheres?

There are 2 ways to texture a sphere. Either by applying a cubemap or by applying a 2D texture. For best result, use a cubemap. The problem with applying a 2D texture is that when you wrap a 2D texture onto a sphere, the top and bottom area of the sphere, the texture looks squeezed.


2 Answers

The hairy ball theorem states that it is impossible to define continuous texture coordinates on a sphere without any poles that distort the texture.

like image 146
palm3D Avatar answered Sep 23 '22 03:09

palm3D


Lat/lon "spheres" distort by definition. If you're into programming, start with a [tetrahedron](http://en.wikipedia.org/wiki/Tetrahedron Tetrahedron) and subdivide as much as necessary, by subdividing each triangle into 4 triangles and repositioning midpoints at the given radius from center.

If you're into modeling, the GeoSphere (as previously mentioned) or any similar will solve your problem.

The point is that the triangles will have a constant amount of distortion which is independent of the latitude.

Also note that a (closed) surface subdivision will enable you to have a (C)LOD rather easily.

Texturing is another story, but once you have a good sphere you have less problems.

Hope this sparks your imagination :)

like image 21
ptor Avatar answered Sep 21 '22 03:09

ptor