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 ?
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!
I checked those. probably not enough.
so swiz n would "unpack" the plane n ..?
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 :)
in1.0, in1.1, etc doesn’t work?
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…
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 :)
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…