6
\$\begingroup\$

I'm doing a tactical game (X-Com / Fallout style) for fun. I've decided to use a hexagonal map, but I'm having a graphic problem.

My current map display is HUD-like, with only the border of the map cells displayed, without any texture. It's simple and allows for display of different types of information by varying the color of the border. For example, the "danger view mode" displays the borders with a color going from green (no damage possible) to red (prob of damage > 90%).

Now, it's a bit hard to differentiate the kind of tile the player is on. I could put a plain color (green is grass, pale blue is water...), but this is going to limit the possibilities. Thus, I would like to display a texture on my tiles. Since the maps are generated, I can not use a picture for the whole map with the HUD over.

So, my question is: does anyone know how can I generate the seamless hexagonal textures (algo or plugin)?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ The site's design inspires such questions :D \$\endgroup\$ Nov 12, 2010 at 21:11

2 Answers 2

1
\$\begingroup\$

Can't you just do a planar projection of a regular tiling texture onto your tiles and just have hard edges where your tile types switch? So on your hexes that are "grass" just map their UVs in "map space" to a repeating grass texture.

\$\endgroup\$
3
  • \$\begingroup\$ i didnt know how to map the grass texture on an hexagon, and stupidly rejected the solution. After a little bit of thinking, I found how to do a triangle strip with (i think) a good UV mapping. Will try this evening. Thanks \$\endgroup\$ Nov 12, 2010 at 15:24
  • \$\begingroup\$ i still get a few quirk on my mapped hexagon, but its works. thanks again \$\endgroup\$ Nov 15, 2010 at 0:49
  • \$\begingroup\$ @PATRY I strongly suggest Cocos2d. They've saved me a TON of dev work. \$\endgroup\$ Nov 15, 2010 at 17:09
1
\$\begingroup\$

Take an ordinary texture and chop it up to make your hexagonal tiles.

To clarify: Take a seamless texture that's square. Use appropriate bits of it to make your hexagons. If you select your pieces appropriately you get a seamless texture on your hexagons. Note that each hexagon gets a different piece of the underlying texture up until the point the pattern repeats.

\$\endgroup\$
2
  • \$\begingroup\$ but then they won't be seamles, no ? (that's one of the solution i used in the end, but it worked well if i added the bondaries of the hexes) \$\endgroup\$ Jul 1, 2012 at 17:28
  • \$\begingroup\$ argh. i was re-reading my old question when i occured to me. the important part that i missed was "Note that each hexagon gets a different piece of the underlying texture up until the point the pattern repeats." ! by using a square texture duplicated several time, and mapping differently for even and odd hexagon, i should got a working solution. thanks \$\endgroup\$ Oct 11, 2012 at 8:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .