I love it when a plan comes together.
In my last post I mentioned that there was a problem in X/Y translations of hexagon ‘bitmaps’.
I was a little worried when in the middle of this I realised the hexagon substrate mapping and rendering method has been chosen on instinct, for efficiency. It was this packing/rendering method that was making the complication in X.Y translations. I’m not unpacking rectangular bitmaps into a regular space, but a zig/zaggy serpentine one.
If there was a good reason to opt for a different rendering method then I really wanted to know about it now so I could simply things all the way down now, before I built on-top of it.
So my firsts step was to prove that the rendering method was better than the alternative. In the end I managed to come up with a nice little ‘proof’ (to myself) and could move on.
Seems it uses 15% less effort by the GPU and the code is simpler because it is susceptible to come cool logic tricks.
So all is now good – We have some consistent translations at least for this test case.
Compare this to what was in my previous post.
Tomorrow I will create some more tests and see if this is a complete fix.
Once this is verified, Turtle Time! 🙂