Forums > Jitter

jit.gl.multiple lay out on grid

October 10, 2008 | 9:13 am

Hi List,

Bit of noob question here, sorry for my ignorance but after days of pulling out my hair I’m still finding it really hard to get my head round the jit.gl.multiple it terms of how the new instances are positioned, I’ve read the documentation, played with the help patch extensivly and scoured the forums but still dont really understand how to tell the instances to position themselves. I have a gl.mesh which is captured to multiple and then on to a plane something like below, what I’d like to do is lay it out on a grid or layout 3 beside each other but I really cant understand how to position each instance.

Can some good samaritan patcher point we in the right direction as I really dont understand how to send simple x y z messages for each multiple instance.

Thanks in advance for any help you can offer

Cheers

JK

#P window setfont "Sans Serif" 9.;
#P flonum 483 58 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 286 61 151 196617 jit.expr @expr 0. 0. "norm[0]";
#P newex 312 81 149 196617 jit.op @op * @val 1.;
#P newex 312 40 115 196617 jit.matrix 3 float32 20;
#P newex 312 102 352 196617 jit.gl.multiple sample @targetname plane @glparams position @capture tex2;
#P connect 1 0 3 0;
#P connect 3 0 2 0;
#P connect 4 0 2 1;
#P connect 2 0 0 0;
#P window clipboard copycount 5;


October 10, 2008 | 5:56 pm

you send jit.gl.multiple a matrix with 3 planes. The value of each plane corresponds to x y and z coordinates. The number of cells in the matrix delineates how many iterations of the object you see. If you made a 3 plane 4×4 matrix, you would get 16 objects. I’ve made an example patch with one multiple of a sphere. Play with the floats and you’ll see how it works.

Here’s a link to a picture of the patch. I’m using max5 and I don’t think I can post a patch as text that will work with older versions?

http://www.bryanteoh.com/multiple_example.jpg


October 10, 2008 | 7:15 pm

Hi there,

Thanks so much for your help, I really appreciate it. Your example
helps a lot but I’m still a little confused as to how I would go
about changing the position of the instances of each object
separately, if I change your example to a 4 x 4 matrix like this
jit.matrix example 3 float32 4 4 and change the floats I presume each
instance is rendered to exactly the same position, how would I go
about changing each instance independently?

Thanks again for your help on this!!

Cheers

JK
On 10 Oct 2008, at 18:56, bryanteoh wrote:

>
> you send jit.gl.multiple a matrix with 3 planes. The value of each
> plane corresponds to x y and z coordinates. The number of cells in
> the matrix delineates how many iterations of the object you see.
> If you made a 3 plane 4×4 matrix, you would get 16 objects. I’ve
> made an example patch with one multiple of a sphere. Play with the
> floats and you’ll see how it works.
>
> Here’s a link to a picture of the patch. I’m using max5 and I
> don’t think I can post a patch as text that will work with older
> versions?
>
> http://www.bryanteoh.com/multiple_example.jpg
>
>
>

Jack Keenan
3sixty-tv coordinator
Peacock Visual Arts
21 Castle Street
Aberdeen
AB11 5BQ

01224 639539

http://www.threesixtytv.com
http://www.peacockvisualarts.com

Registered in Scotland No. SC 56235
Charity No. 14840


October 10, 2008 | 7:37 pm

Hi there,

Thanks so much for your help, I really appreciate it. Your example helps a lot but I’m still a little confused as to how I would go about changing the position of the instances of each object separately, if I change your example to a 4 x 4 matrix like this jit.matrix example 3 float32 4 4 and change the floats each instance is rendered to exactly the same position, how would I go about changing each instance independently?

Thanks again for your help on this!!

Cheers

JK


October 11, 2008 | 8:41 am

that’s kind of where the challenge in patching is. In this case we’re using a 3 plane matrix. Plane 0 is the x axis, plane 1 is the y axis, and plane 2 is the z axis. Each cell of the matrix corresponds to to the position of a single object. If the matrix is a size of 2×1, then you’ll get 2 objects each with an x y an z coordinate because it’s a 2×1 matrix with 3 planes. You can set the value of either one or both of the cells using any of the methods described in the jitter tutorials pertaining to the manipulation of matrices. Use jit.noise if you want something random, or use jit.fill if you know specifically where you want to place each object. If you want to place several objects in very specific places, you have to face either creating a ton of message boxes which will place each object individually, or write an algorithm that will do all the work for you.

Keep playing with this patch and the help patcher for jit.gl.multiple and I’m sure you’ll come up with something.


October 11, 2008 | 5:24 pm

Thanks for your help your example gave me enough to (partially) get my head round gl.multiple, I have it working now using the following method.

Cheers

JK

#P window setfont "Sans Serif" 9.;
#P flonum 515 144 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 173 184 352 196617 jit.expr @expr "snorm[0]*in[1]" "snorm[1]*in[1]" "sin(smorm[0]*TOPI)";
#P newex 16 308 386 196617 jit.gl.gridshape sample @shape plane @automatic 0 @name plane @scale 0.5 0.5 0.5;
#P newex 175 231 292 196617 jit.gl.multiple sample 5 @targetname plane @glparams position;
#P newex 172 144 158 196617 jit.matrix example 3 float32 4 4;
#P newex 18 169 56 196617 jk.window;
#P newex 16 123 66 196617 jk.metro;
#P toggle 15 82 15 0;
#P connect 1 0 5 0;
#P connect 7 0 6 1;
#P connect 6 0 4 0;
#P connect 3 0 6 0;
#P connect 1 4 3 0;
#P connect 0 0 1 0;
#P window clipboard copycount 8;


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