n planes matrices as input of jit.gen / how to retrieve planes ..?

Jun 15, 2012 at 9:22pm

n planes matrices as input of jit.gen / how to retrieve planes ..?

if I sent an n planes matrix to a jit.gen, what is the rule to retrieve a particular plane ??

I’m currently sending an 1×1 matrix with 4 planes to the first inlet of my jit.gen
I’m mapping the in 1 to a codebox, on the first inlet too
so in1.x, .y, .z are the first 3 planes

how can I have the fourth and more generally, the n-th for an m planes matrix ?

Jun 15, 2012 at 10:29pm

if i am right the swiz message works like unpack. for example swiz r – red plane, or for geometry swiz 0 for x :)
have you checked out gen tutorials? they are great!


Jun 15, 2012 at 10:39pm

I checked those. probably not enough.

so swiz n would “unpack” the plane n ..?

Jun 15, 2012 at 10:50pm

it works (of course it does, I didn’t think ever you pointed me on a wrong way :)

I thought about a solution inside a codebox/genexpr, but this is totally ok to split things before then to wire the codebox.

MAXi thanks, napentro :)

Jun 16, 2012 at 9:02am

in1.0, in1.1, etc doesn’t work?

Jun 16, 2012 at 9:08am

it doesn't
in1.x, in1.y, in1.z … works very fine
but grabbing the 4th planes (and the other) … I don't know.

swiz works correctly. but if you wanted to do all in codebox .. I couldn't help :-/


  1. in0.1.PNG
Jun 16, 2012 at 9:14am

4th plane you should get with in1.w .x .y .z or .r .g .b .a (doesn’t matter if it’s not colors in your matrix). 4+ planes i don’t know…

Jun 16, 2012 at 9:22am

oh .. so 6 would be u, v, w, y ,x,z ?
I’ll test that asap :p

but you know, swiz is the way I guess
easy numbering 0, 1 ,2 with swiz 0, swiz 1 for the 2 first planes etc

(still in the view frustum culling stuff here :)

Feb 27, 2013 at 11:44pm

A bit different question, but I’m trying to swiz a 12 plane matrix, but

“swiz 10 11″ will be translated as “swiz_3 = swiz(in1, vec(1, 0, 1, 1));”

so seems swiz can handle only 0-9 planes?

is there a workaround for this?

thanx in adv,

ps: i can do it if i write in a codebox “out1 = swiz(in1, vec(3,4,5,6,7,8,9,10, 11));” but i’m not sure it’s the best solution…


You must be logged in to reply to this topic.