Hexagon Problem

Hi,

I try to create a game which consist of a lot of hexagons. My Problem is, that each side of each hexagon can have a different color. My first approach was to use a blender model where each side gets its own spatial where a material can be assigned. My model looks like this:

http://img42.com/fwwff

The Problem with that is, it cost a lot of performance. My framerate is dropping from about 2k fps (just the hexagon without the sides) to 400 fps. For my test case thats fine, but it will not work with android.

I thought a texture could solve the problem. But how can I assign it dynamic, so that each side could have a different color (depending on the game state).

Well several things

-> Use a texture atlas, as then each can use the same material. There is an atlasTexture tool somwhere in jme’s source
-> Batch the resulting hexagons together.

This should reduce your board to one object.

Okay, I think I have to create a texture with all 64 possibilities. Do you know a graphic program which can help to produce such texture?

When I batch the resulting hexagons together can I translate or rotate them in further game stages?

I heard this works great for a standalone solution
http://spritesheetpacker.codeplex.com/
Otherwise
https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:texture_atlas

Using a batchnode you can move them, then rebatch.

It might be necessary to use chunks of x*y hexagons to balance batch processing time vs rendering speed.

Thank you, now I have some ideas how to solve this.

I also found this interesting post http://hub.jmonkeyengine.org/forum/topic/newbie-question-on-how-to-draw-a-custom-texture/