libmorton icon indicating copy to clipboard operation
libmorton copied to clipboard

Creating Tables for N-Dimenstion

Open Gillani0 opened this issue 8 years ago • 3 comments

Hi,

Sorry for opening such and issue. However, I was interested if its possible to generate Morton code for n-dimesnsions using the precomputed tables. That is, generating such tables for LUT. Cheers

PS: I can't seems to find the coding and decoding version of naive for-loop implementation (as discussed in your blogs).

Gillani0 avatar Feb 10 '17 14:02 Gillani0

Here's the encoding version for 3D using a for loop: https://github.com/Forceflow/libmorton/blob/master/libmorton/include/morton3D.h#L120

And here's the decode: https://github.com/Forceflow/libmorton/blob/master/libmorton/include/morton3D.h#L250

Forceflow avatar Feb 10 '17 21:02 Forceflow

Hi, thanks for pointing it out. Apparently I missed these functions.

Any idea to extend the "for loop" for a generalised N-dimenstions? I've tried while following the same approach for 2-d and 3-d. However, the the decoding function is not producing the expected results. Cheers.

Gillani0 avatar Feb 12 '17 12:02 Gillani0

I'll look into generalized (n > 3) functions later, though the techniques should be very similar.

Forceflow avatar Feb 17 '17 11:02 Forceflow