Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Hexagonal Grids (2013).
I wanted to put obejcts into bins so that pairs which are unlikely to collide are not checked.
Square bins are nice, but an object can potentially be in four of them at a time.
Hexagonal bins on the other hand reduce that number to three - great, but assignment is not as obvious.
If you look at the hex pattern the centers form a skewed grid - an appropriate affine transform should deal with that.
Does it help? Kinda. Coordinates in "hex space" are weird and now I see why - I'm using the wrong coordinate system to begin with.
[0] Making a game after-hours - the real project here is escaping from the immensely pragmatic world of writing software for money.
There are no comments on this comment yet.
I wanted to put obejcts into bins so that pairs which are unlikely to collide are not checked.
Square bins are nice, but an object can potentially be in four of them at a time.
Hexagonal bins on the other hand reduce that number to three - great, but assignment is not as obvious.
If you look at the hex pattern the centers form a skewed grid - an appropriate affine transform should deal with that.
Does it help? Kinda. Coordinates in "hex space" are weird and now I see why - I'm using the wrong coordinate system to begin with.
[0] Making a game after-hours - the real project here is escaping from the immensely pragmatic world of writing software for money.