Another progress update: WorldToGrid
and GridToWorld
are now implemented.
For those who don't know, those two functions convert a point's coordinates
from world space to grid space, the coordinate system used to locate points
relative to the grid's properties, and back. For rectangular grids it's a
fairly simple idea, the grid can be represented as a standard Cartesian
coordinate system. With hex grids that won't do it, you simply cannot force a
hex grid into a Cartesian coordinate system, you need to find something else.
Fortunately there are several topologically identical possibilities with
easier, more intuitive coordinate systems. For the first release I have decided
to use the herringbone pattern:
Continue reading…