While reading through your work (THANK YOU! ❤️ ) to understand the scan pattern, I noticed that there could be some room for making things easier to maintain and bringing support for flipping.
Instead of mutating the position array, you could do a fast transformation matrix multiplication during rendering. Bonus: the same transformation matrix can also be used for horizontal/vertical flipping.
While reading through your work (THANK YOU! ❤️ ) to understand the scan pattern, I noticed that there could be some room for making things easier to maintain and bringing support for flipping.
Instead of mutating the position array, you could do a fast transformation matrix multiplication during rendering. Bonus: the same transformation matrix can also be used for horizontal/vertical flipping.
Here's how I use a transformation matrix in my FREKVENS hack: https://github.com/atesgoral/node-omega-frekvens/blob/master/lib/frekvens/src/OmegaDriver.cpp#L51-L58
And here's how that transformation matrix is set up, based on rotation and flip:
https://github.com/atesgoral/node-omega-frekvens/blob/master/index.js#L181-L205