Results 1 to 6 of 6
  1. #1
    samanyu is offline Member
    Join Date
    Jun 2011
    Location
    Tsukuba, Japan
    Posts
    63
    Rep Power
    0

    Default 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. #2
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    a sphere consisting of hex-grids
    I have no idea what you mean.
    No bug ever had to calculate its fitnessfunction.

  3. #3
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,058
    Rep Power
    6

    Default

    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.
    Get in the habit of using standard Java naming conventions!

  4. #4
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    @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.
    No bug ever had to calculate its fitnessfunction.

  5. #5
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,058
    Rep Power
    6

    Default

    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
    Get in the habit of using standard Java naming conventions!

  6. #6
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    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.)
    No bug ever had to calculate its fitnessfunction.

Similar Threads

  1. 2d array grid
    By rjsupaflea in forum New To Java
    Replies: 14
    Last Post: 06-07-2011, 02:47 AM
  2. Grid Painting?
    By iCon09 in forum New To Java
    Replies: 2
    Last Post: 02-26-2011, 07:04 AM
  3. Drawing a grid
    By CrystalMoth in forum Java 2D
    Replies: 11
    Last Post: 01-10-2010, 05:07 AM
  4. How can I square(^2) the pic in the grid
    By racewithferrari in forum New To Java
    Replies: 2
    Last Post: 11-03-2009, 05:27 PM
  5. How can I square(^2) the pic in the grid
    By racewithferrari in forum New To Java
    Replies: 1
    Last Post: 11-01-2009, 10:16 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •