* rectangular maps require an adapter, shown in the map storage section They seem potentially useful for fixed sized hexagonal shaped maps. See this question or this question on stackoverflow, or this paper about machine vision, or this diagram about "generalized balanced ternary" coordinates, or this math paper, or this discussion on reddit. There are spiral coordinate systems I haven't explored. One of the interesting properties of that system is that it reveals hexagonal directions. There are also cube systems that use q-r, r-s, s-q. Some have the 120° axis separation as shown here and some have a 60° axis separation. There are also many different valid axial hex coordinate systems, found by using reflections and rotations. Some of them have constraints other than q + r + s = 0. There are many different valid cube hex coordinate systems. To avoid confusion in this document, I'll use the names q r s for hexagonal coordinates (with the constraint q + r + s = 0), and I'll use the names x y z for cartesian coordinates. In previous versions of this document, I used x z y for hexagonal coordinates and also for cartesian coordinates, and then I also used q r s for hexagonal coordinates. If you have any references, please send them to me. Tamás Kenéz sent me the core algorithms (neighbors, distances, etc.). Other possible names: brick or checkerboard. I haven't found much information about this system - called it interlaced, rot.js calls it double width, and this paper calls it rectangular. You can either offset the odd or the even column/rows, so the horizontal and vertical hexagons each have two variants. The most common approach is to offset every other column or row. I like cube coordinates for algorithms and axial or doubled for storage. With hexagons, there are multiple approaches. With square grids, there's one obvious way to do it. Geometry # Spacing # Angles # Coordinate Systems # This page includes interactive diagrams that require your browser to have SVG and Javascript enabled. The implementation guide has code in C++, Javascript, C#, Python, Java, Typescript, and more. The code samples on this page are written in pseudo-code they're meant to be easy to read and understand. I wrote this guide to the most elegant approaches that lead to the simplest code, starting from the guides by Charles Fu and Clark Verbrugge. I've been collecting hex grid resources for over 25 years. This guide will cover various ways to make hexagonal grids, the relationships between different approaches, and common formulas and algorithms.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |