Forums > Jitter

Mapping between planes and dimensions in jitter matrices

April 26, 2013 | 5:19 am

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


April 26, 2013 | 9:18 am

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

http://cycling74.com/2012/02/02/gen-tutorial-2a-the-joy-of-swiz/


Viewing 2 posts - 1 through 2 (of 2 total)