# Thread: drawing a 3D hex-grid map

1. Member
Join Date
Jun 2011
Location
Tsukuba, Japan
Posts
63
Rep Power
0

## drawing a 3D hex-grid map

Dear All,
Do you know where I can find a trial java version of a 3-D hexagonal grid map? Meaning, I need a map which is basically a sphere consisting of hex-grids on which I can click and select and then change properties.
Its used in some games, so I figured someone might know something about it.
Cheers.

2. a sphere consisting of hex-grids
I have no idea what you mean.

3. I tried to write something like that (in C++) and didn't get very far. The part I got hung up on was U,V mapping. But basically, you start with a dodecahedron and keep bisecting the edges, turning each triangle into four triangles, and pushing the new vertices out to the radius of the sphere. Then you texture each triangle with a texture that has lines from the center point to the middle of each edge. This creates the appearance of hexagons; game objects that are "in" hexagons are actually at vertices of the mesh. There will always be 12 tiles that are pentagons (the original vertices of the dodecahedron); the rest will be hexagons of similar, but not identical size.

The Wikipedia page on dodecahedrons has the coordinates for the original vertices.

4. @OP:
I was triggered by the sphere consisting of hex-grids, which is mathematically impossible. Just to be sure, did you see this thread:
Developing an Hex-board strategy game
Hardwired makes a (flat) hex-grid there.
Maybe you should explain more where your problem lies, because kjkrum and I are going in very different directions on your question.

5. This might be a dead thread, but I'll post this just because I'm interested: EarthBrowser: Global Grid: The Icosahedral Hexagonal Grid This page that it links to is also a good resource: Discrete Global Grids

6. Hello Kjkrum. Very nice posts. I would almost withdraw my statement about mathematical impossibility
The last time I have been experimenting more with polyhedrons. I made force-based graphs and constructed all kinds of regular polyhedrons, including buckyballs (and much other things like balls in balls, mobiusrings and irregular stuff. At the moment I can't read them back: XML-persistence ).
Do check out Hardwired's (flat) code: it is nice (I have been busy expanding it a little, like MVC and coloring (almost)).
I checked out your project and blog. I like that too. Sorry it is not really my kind of programming (networking), but maybe I could help with some subproject.
(Sorry, out of topic.)