Forums > Jitter

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

June 15, 2012 | 9:22 pm

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 ?


June 15, 2012 | 10:29 pm

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!

http://cycling74.com/2011/11/07/gen-tutorial-1-the-garden-of-earthly-delays/


June 15, 2012 | 10:39 pm

I checked those. probably not enough.

so swiz n would "unpack" the plane n ..?
mmmh
testing.


June 15, 2012 | 10:50 pm

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 :)



dtr
June 16, 2012 | 9:02 am

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


June 16, 2012 | 9:08 am

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 :-/

[attachment=196750,4047]

Attachments:
  1. in0.1.PNG


dtr
June 16, 2012 | 9:14 am

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…


June 16, 2012 | 9:22 am

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 :)


February 27, 2013 | 11:44 pm

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,
Kevin

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…


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