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
    \$\begingroup\$ The site's design inspires such questions :D \$\endgroup\$ – Oleh Prypin Nov 12 '10 at 21:11
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.

| improve this answer | |
\$\endgroup\$
  • \$\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\$ – PATRY Guillaume Nov 12 '10 at 15:24
  • \$\begingroup\$ i still get a few quirk on my mapped hexagon, but its works. thanks again \$\endgroup\$ – PATRY Guillaume Nov 15 '10 at 0:49
  • \$\begingroup\$ @PATRY I strongly suggest Cocos2d. They've saved me a TON of dev work. \$\endgroup\$ – Stephen Furlani Nov 15 '10 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.

| improve this answer | |
\$\endgroup\$
  • \$\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\$ – PATRY Guillaume Jul 1 '12 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\$ – PATRY Guillaume Oct 11 '12 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.