I am a bit confused as I have tested a couple algorithms to compute z-indices and for (8, 8, 8) I get 3584 and for (7, 7, 7) I get 511, which is correct. The issue is 8*8*8 = 512, yet the z-index is 3584. That means if I use a one dimensional array to store things by the z-index, won't I be using more space and there will be empty slots in the array? Similarly 7*7*7 = 343, which is less than 511. If you look on the wikipedia page for z-indexing/Morton encoding, you will find a two dimensional example which is 8*8 with indices of x and y from 0 to 7. However, the largest z-index is 111111 which is 63, which when numbered from 0 is precisely the 64th element, so it does not use more space than necessary to store 64 elements. Is there something wrong here?
Thanks