# drawing a 3D hex-grid map

• 06-23-2011, 05:18 AM
samanyu
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.
• 07-04-2011, 10:27 PM
Jodokus
Quote:

a sphere consisting of hex-grids
I have no idea what you mean.
• 07-13-2011, 02:25 AM
kjkrum
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.
• 07-13-2011, 12:34 PM
Jodokus
@OP:
I was triggered by the sphere consisting of hex-grids, which is mathematically impossible. Just to be sure, did you see this thread:
http://www.java-forums.org/java-2d/1...tegy-game.html
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.
• 07-14-2011, 01:07 AM
kjkrum
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
• 07-14-2011, 01:54 AM
Jodokus
Hello Kjkrum. Very nice posts. I would almost withdraw my statement about mathematical impossibility :(nerd):
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 :s:).
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.)