Forums > Jitter

gen particle with physics?

November 15, 2012 | 6:13 pm

I was wondering if there is a way that the gen particle example (without the black hole math) responds to the jitter physic library?
Or do we have to do that all in gen/math world?

Any help would be greatly appreciated!


November 17, 2012 | 4:00 am

you can give the jit.gl.mesh a jit.phys.body, no?

– Pasted Max Patch, click to expand. –

November 19, 2012 | 5:00 pm

if you want each of the particles to be a rigid-body, you have a few choices.
you can use phys.multiple to manage multiple instances of a rigid-body.

you can set the rigid-bodies to be kinematic, and update their positions directly from the gen simulation matrix.
this means the bodies won’t collide with each other, but they will collide with any non-kinematic dynamic rigid-bodies in your scene.

or, if you want the particles to be dynamic rigid-bodies, you can’t update the positions directly, but must use the phys.multiple force matrix input to apply forces to the rigid-bodies in the direction of the corresponding particle in the gen simulation.


November 19, 2012 | 5:29 pm

@tobiasros
thanks, but in your example your applying physics to the hole grid.

@Robert
That makes sense to me. The reason why I’m asking this is because I need many particles and the gen method seems to be more efficient then anything else I have seen in Jitter. I will give it a try. Thanks!


November 19, 2012 | 6:36 pm

not sure what I’m doing wrong..

– Pasted Max Patch, click to expand. –

November 19, 2012 | 7:51 pm

there’s a couple errors here. you don’t need to provide an arg to phys.world since you are connecting via patchcord.
it will try and use that arg as it’s own worldname, rather than as the gl-context name.

jit.gl.mesh needs a matrix of vertex points if it’s going to draw anything, so in this case, you probably want to use a jit.gl.gridshape as the target object for jit.gl.multiple.

you need to send a matrix to the right input of the jit.gen, if you want any animation to take place. i simply sent in the initial noise-matrix.

– Pasted Max Patch, click to expand. –

November 19, 2012 | 9:32 pm

thanks Robert, great example. I was in the hope to use a mesh. Can we adapt this example for vertex points?


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