gen particle with physics?

jirko's icon

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!

Tobias Rosenberger's icon
Max Patch
Copy patch and select New From Clipboard in Max.

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

Rob Ramirez's icon

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.

jirko's icon

@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!

jirko's icon
Max Patch
Copy patch and select New From Clipboard in Max.

not sure what I'm doing wrong..

Rob Ramirez's icon

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.

Max Patch
Copy patch and select New From Clipboard in Max.

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.

jirko's icon

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