News for hackers. Stuff that matters.
Re:Hexagonal Grids by whartung on Friday October 20, 2023 @09:24AM (#37955645)
This is greatly improved. It’s a beautiful, functional page.

Back when I was playing with hex grids, the orientation he was using (pointy top) wasn’t what I wanted to use, so I really wasn’t able to apply any of it to my work.

So I ended up doing it much on my own. I did scavenge Google for a “distance” formula and that took a couple of goes.

I’ll have to read it in more detail to see whether it’s worthwhile to adopt this vs just sticking with what I have.

Re:Hexagonal Grids by amitp on Friday October 20, 2023 @11:03AM (#37957110)
Two ways of thinking about pointy vs flat top:

1. Pointy and flat are 60° rotations away from each other. This is what I use for animations. But it's not as useful for the math.

2. Pointy and flat are the same with x/y flipped. This is much more useful for coding.