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 ?

#46151
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!

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

#166228
Jun 15, 2012 at 10:39pm

I checked those. probably not enough.

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

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

#166230
Jun 16, 2012 at 9:02am

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

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

[attachment=196750,4047]

Attachments:
  1. in0.1.PNG
#166232
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…

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

#166234
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,
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…

#166235

You must be logged in to reply to this topic.