Mapping between planes and dimensions in jitter matrices

John J.A. Jannone's icon

Dear all,

What is the simplest way to convert between matrix dimensions and planes?

e.g.:

I make a jit.matrix 6 float32 10 20

Where
planes = rgbxyz
10 = objects
20 = object history

And where in one instance I want to interpret this as: jit.matrix 20 float32 10 6
so I can use a jit.iter to iterate across the 20 dimensions, producing the color/position history of each cell as a list...

Can it be done neatly?

Thanks,

John

LSka's icon

this seems a good place for jit.gen
have a look here for a tutorial about the 'swiz' operator, which can be what you want
https://cycling74.com/tutorials/gen-tutorial-2a-the-joy-of-swiz/