I'm trying to make a simple 2D voxel quadtree engine that uses as little memory as possible i.e one bit per voxel, which I know can be done. The major problem I encounted is try to get a coordinate of a voxel.
I'm not sure whether it's the standard system but ive organised it so the data is just one big stream. For example; 1001001100111011011000100011
Because of the nature of a quad tree you know that the first 4 are the first branch. Then you times the number of 1s in the first branch by 4 to get how many are in the second branch and so on. This means you can work out it's
So, based on the position of it in the stream, it should seem possible to work out the coords but I cant think of the mathmatical way of doing it.
I've made it so in each quad the sections are ordered like this: