
Hexagonal Grids - Red Blob Games
Adjacent hexagons are distance 1 apart in the hex grid but distance 2 apart in the cube grid. For every 2 steps in the cube grid, we need only 1 step in the hex grid. In the 3D cube grid, …
Implementation of Hex Grids - Red Blob Games
When you read the equality, hex_add, hex_subtract, hex_scale, hex_length, hex_round, and hex_lerp functions below, you’ll see how it might be useful to treat the coordinates uniformly. …
Hexagonal Grids - Red Blob Games
Hex-Grid Utilities [43] is a C# library for hex grid math, with neighbors, grids, range finding, path finding, field of view. Open source, MIT license.
Red Blob Games
Hexagonal grid reference and implementation guide Also: non-orthogonal bases, relation to cubes
Grid parts and relationships - Red Blob Games
Mar 3, 2021 · 2 Hexagon Grids # In this article, I use pointy-top hexagons, but the math works the same if you want flat-top hexagons. To construct hexagon coordinates, we can start with a …
Line drawing on a grid - Red Blob Games
Dec 1, 2014 · On a grid map, line drawing is useful for for visibility, the path of an arrow/bullet, and enemy AI. I sometimes see people adapting the Bresenham line drawing algorithm to draw …
Hexagon Shaped Hex Map Storage - Red Blob Games
Apr 30, 2023 · Map storage with hexagons [1] isn't as straightforward as with rectangular maps on a square grid. A rhombus shaped hex grid corresponds to a 2D rectangular array. But a …
Hexagon directions - Red Blob Games
Apr 21, 2018 · I wonder if there's a way to use spirals from cos/sin [2] with hexagonal grids [3] to construct hexagonal spirals on a grid.
Hex region borders - Red Blob Games
Sometimes you want to outline a region on a hex grid. Here are two techniques for that. Both of these techniques also work on other convex polygon maps, including square grids and triangle …
Hexagon spiral coordinates - redblobgames.com
Mar 12, 2025 · Spiral coordinates on a hexagonal grid. I decided to make some diagrams showing the parts I do understand. This also led me to try to understand more. I gave some …