Drawing an outline around an arbitrary group of hexagons
- by Perky
Is there an algorithm for drawing an outline around around an arbitrary group of hexagons?
The polygon outline drawn may be concave. See the images below, the green line is what I am trying to achieve. The hexagons are stored as vertices and drawn as polygons.
Edit:
I've uploaded images that should explain more. I want to favour convex hulls because it's conveys an area of control more quickly.
Each hexagon is stored in a multidimensional array so they all have x and y coordinates, I can easily find adjacent hexagons and the opposite vertex, i.e. adjacentHexagon = getAdjacentHexagon( someHexagon, NORTHWEST ) if there isn't a hexagon immediately adjacent it will continue to search in that direction until it finds one or hits the map edges.