gen particle with physics?

Nov 15, 2012 at 6:13pm

gen particle with physics?

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!

#65221
Nov 17, 2012 at 4:00am

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

– Pasted Max Patch, click to expand. –
#235027
Nov 19, 2012 at 5:00pm

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.

#235029
Nov 19, 2012 at 5:29pm

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

#235030
Nov 19, 2012 at 6:36pm

not sure what I’m doing wrong..

– Pasted Max Patch, click to expand. –
#235031
Nov 19, 2012 at 7:51pm

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. –
#235032
Nov 19, 2012 at 9:32pm

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

#235033

You must be logged in to reply to this topic.