my problem is that I am terrible at math and I’m making the flattened 3d array version of those cubes with random examples I found on the web. I think I found the algorithm (not entirely sure it is right) for indexing the cubes in the array
I don’t have time to figure out the algorithm right now, but I’m pretty sure that you will have to use 2-3 “Division w/ Remainder” nodes, the int return value will give you the X/Y/Z.
Using the Division (whole and remainder) node, you can get your x, y and z coordinates for index i as follows:
z = i / (x*y), which leaves remainder r1
y = r1 / x, which leaves remainder r2
x = r2
Well, it appears that the Division (whole and remainder) nodes require floats, so you’re probably better off doing it by hand to keep integers all the way.
I attached a picture showing how I did it, without checking for the validity of the index.