icosahedron / hexasphere / geodesic sphere code/math
category: code [glöplog]
if you have regular hexagons, those have like 120 degrees in each corner, three of them meet, that's 360 degrees, which means the result will be flat, not curved. A sphere has positive curvature, will have less than 360 degrees meeting at a single point (if the polygons are big enough, like bigger than infinitesimal). Think about a cone, which is an extreme example. This is why football have pentagons and hexagons alternating instead of just hexagons (hi gargaj :). A regular pentagon has 108 degrees internal angle, so two hexagons and one pentagon is less than 360 degrees, making it possible to form an approximation of a sphere.
i personally like to normalize the vertices of a cube:
http://www.iquilezles.org/www/articles/patchedsphere/patchedsphere.htm
which gives you pretty decently equally sized polygons, and of course a natural (somehow stretch-free) texture mapping coordinates, if you are still in that whole UV mapping thing.
http://www.iquilezles.org/www/articles/patchedsphere/patchedsphere.htm
which gives you pretty decently equally sized polygons, and of course a natural (somehow stretch-free) texture mapping coordinates, if you are still in that whole UV mapping thing.
if you're into boxmapping, you mean ;)
If you want a low distortion mapping with simple code, you might give this a try http://blog.marmakoide.org/?p=1
some nice stuff in this thread. thanks everyone!
iq: Normalization rules!!
used that method not only once in the past..
used that method not only once in the past..