GeoSphere creation

Started by
2 comments, last by Wyrframe 20 years, 2 months ago
I need to generate a Geosphere at run-time, but I''m not sure how to do it... other than, of course, hard-coding every vertex and polygon. Could someone help me with finding a starting point for doing this? NOTE: Texture mapping coords not needed. ALSO NOTE: I don''t need much theory... I just need a starting point so that I can wrap my brain around it myself...
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
Advertisement
have a look at http://astronomy.swin.edu.au/pbourke/
*bump*, and a solution for those who come by this in the future;

Easiest method; take a simple 6-sided 12-triangle cube, with its center at the origin and its corners at (±1,±1,±1). Tesselate it, such that each quad (pair of triangles) becomes four quads (eight triangles) meeting in the center of the original. Repeat as desired, essentially doubling detail each time.

+-------+           +---+---+|\      |           |\  |\  || \     |           | \ | \ ||  \    |           |  \|  \||   \   |  becomes  +---+---+|    \  |           |\  |\  ||     \ |           | \ | \ ||      \|           |  \|  \|+-------+           +---+---+  


Now, take every vertex and normalize its position. I really can't think of why I didn't think of this when I first stared down at a wireframe of a geosphere.

What you will get is a geosphere; in the shape of a sphere but with six distinct groups of triangles, and with a very even vertex distribution. The vertices that were after the first (and every subsequent) tesselation will still be at their original location, since they are at unit vectors (ie (1,0,0), (0,-1,0), etc), and every other vertex will end up where it would be if it were on the surface of a sphere.

For those who don't know, "normalize" means take a vector and make its length exactly one by dividing each component (X,Y,Z) by the pre-normalization length (sqrt(X*X + Y*Y + Z*Z)).

Hope this helps!

Against TCPA!

I am a signature virus. Please add me to your signature so that I may multiply.

[edited by - Wyrframe on March 1, 2004 2:22:23 AM]
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
the best method, leading to the most even spacing afaik, is to take a isocahedron, which has 20 equal triangular faces. you can apply to the same principle to these faces as you would to a cube, but since it has more faces, the faces span a smaller part of the sphere, and thus are less affected by distortion.

ive implemented this once, and the difference in size between the smallest and largest triangle was just 8%. this was with some additional measures to counter distortion when normalizing the vertex positions though.

This topic is closed to new replies.

Advertisement