Closed omarathon closed 8 months ago
I think you're making a logic error here. 48 is not a power of two, the rest of your test dimensions are.
Morton codes fit in the UPPER BOUND of the power of two of their active bits, in the power of two. So your morton codes in a 48x48 grid map on values in the range of 0 to (64*64)-1.
hello,
in the below function I use your library to re-map an input vector of integers in row-major order (corresponding to an NxN array) to a vector in z-order:
somehow, this code works for N=2,4,8,16,32,64,128,256, but it does not work for N=48. with N=48, the generated mortonCode exceeds the max index of the output array.
am I using
libmorton::morton2D_32_encode
wrong?thanks