This project is live on the Asset Store - HexGlobe
(v1.02 released 10/29/12)
Web Demo:
http://www.electricrune.com/Worlds4/GeoGlobe4.html
The Early Version (0.1)
(keep reading for 0.2)
http://www.electricrune.com/GeoSphere/GeoSphere.html

My first version used a limited subdivision routine that could only split the faces into halves/quarters/eighths/etc, and it crashed with too many vertices after level five.
The picture above (and the player) show level three, with eight divisions per original face.
It could do 16 and 32, but crashed at level six (64 divisions).
Still, I used it as an early prototype, figuring out how to place the interactive components on the map, and key them to the actual surface.
In the first demo, you can mouse over the individual hexes, and the GUI will display vars that are associated with each hex on the globe (Latitude, Longitude, and the terrain type).
This demo also shows a routine I am experimenting with to make the map look less ‘hexellated’: the actual colors of the hex are painted on the hex, but stops short of the border, leaving a white band.
Then I run what I call a ‘FireFill’ on the white area which basically randomly grows the existing neighboring colors into the white space until it is all filled.
It is pretty basic (and slow), but it is experimental at this point.
I didn’t like the restriction on how many times I could subdivide each original facet, so I started over from the ground up, and this is the result so far:
Version 0.2
http://www.electricrune.com/Worlds/Worlds.html
I threw a texture from an icosahedral map of Earth. The seams that are apparent are from that texture, when the textures are blank, it is smooth as a cue ball. This picture shows level 50, with 100-mile hexes, 250 around the Equator, and 25002 hexes (12 are always pentagons, at any level).
This one doesn’t have the code to highlight the hexes yet, but I have implemented that in the working version. (This version is about five days old)
Also, the actual painting of the hex colors isn’t in this version, but it is part of the current version I am working on at this very moment.
Drag the slider on the left to get started, a button will appear once the value has been changed.
You can see the data on number of hexes, length of the Equator, and size of the hexes updating as you slide.
Click MAKE GLOBE, and it will tessellate and normalize the globe to a sphere.
Click DRAW HEXES to draw the hex borders. There will be a slight pause during processing, I didn’t write it as a co-routine (yet).
This version can hexellate the globe anywhere from two to one hundred hexes per original triangle edge.
(Actually, it can go up to 140 before it starts to run into vertex limitations)
Stats on a level 100 globe:
Equator = 500 hexes
Hex Size = 50 miles (flat side measurement)
Number of Hexes = 99,990 (+12 pentagons)
I used a layered material, so the hex borders are a separate texture from the underlying map data, and could be toggled on and off. They can also be of two different resolutions.
I’ve come up with a very fast way of drawing the textures; those hexes are calculated and drawn in real time, hence the short pause when you click DRAW HEXES. Drawing filled hexes takes a little longer, but its really pretty quick, considering all the calculation going on…
Version 0.3…
Currently moving ahead to planetary terrain generation. I will seed the world with land, based on a given percentage of water/land, and then run a simple plate-tectonic model to bump up mountains and merge/tear apart landmasses.
This will establish where the land is, and what is mountain/hill/flat…
Then the plan is to generate a simple weather model to set up winds that will blow air from over water onto land, and establish biomes. Areas in the middle latitudes that get a lot of rain will be jungle; at higher latitudes, forest; at arctic level, glaciers. Areas that get winds that blow from overland will be dry (Desert/Steppe/Tundra).
The other thing that is in development is the simple fact that one could take any given section of the globe, or any specific hex, and expand and subdivide to any degree needed. You could take a 100-mile hex and blow it up and have twenty-mile hexes. Then you could have another level with one-mile hexes. Or you could just go straight to a map with 100 one-mile hexes…
A simple interpolative routine would use the terrains from the main hex and the neighbors, spread the terrain across the new sub-hexes, et viola…
I’m not sure yet what the final product is for this; whether it is something I try to sell on the Asset Store, if it is going to be a part of a war game, or if it is going to be part of a space game.
One thing I am sure of, it has worlds of potential… (ba-dum-bum-ting!) ![]()




