help plz with particles ?

kestaya's icon

Hey!

so im new to max msp and this forum, what got me interested was watching this video :

and wondering how they did it! so i already have a tracking system using my webcam that outputs co-ordinates..
but how can i make a plane (matrix?) with all the "images" ? ( in this case all the tiny umbrellas)
is it some sort of particle system? if so then how can i generate particles of a certain image on jitter?

thnx for ur time and help!

Dg's icon

You should have a look at [jit.gl.mesh] and search how to make textured quads. Then you need to set the position of the quads and [cv.jit.HSflow] will give you the movement direction of the user.

kestaya's icon

thnx for the reply..ive taken a look at the objects.. still not too sure about how jit.gl.mesh ..do u know of any further readings/help into it?

thnx again :)

Andrew Benson's icon

The Jitter Recipe "Shatter" could be retrofitted to take an image mask instead of a scalar velocity value to do image-controlled particle motion. Below is an example using frame differencing, to give you an idea.

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

Andrew

kestaya's icon

WOW...thnx alot for ur help and time ...im still having a deeper look into that and checking out how i can edit it for my project..

p.s. i was actually JUST reading ur Jitter recipes :)..thnx for all the help and info ur presenting to us newbies :)

kestaya's icon

hey again mr. Andrew ..

so i did some adjustments to the patch (added a tracking system, import image instead of using live input and so on)..

the only thing i dont know how to adjust in your patch is how the "shattered" pieces act..i think its through the pieces_parts subpatch ..but cant be sure..

how can i control the distance they move away from the imported picture? and also the size of the shatterd pieces?

thnx alot for ur help and time :)

Andrew Benson's icon

The movement of the particles is happening on the upper right of the pieces_parts subpatch, and is really super basic force integration physics. The idea is, you provide a matrix of velocities (here jit.noise), and then add the velocity values to the position matrix and store the result (hence the named matrix). By multiplying the velocity matrix by a scalar value, you can alter the overall motion in the system. This particle motion setup is used a lot in the Jitter Recipes as a basic ingredient.

Andrew

kestaya's icon

thank you =) works much better now!

laserpilot's icon

Very nice example, Andrew. Could your above example be easily incorporated into the effects chain of your VPS recipes? I haven't quite cracked the code of using these more intensive opengl examples in a video filter chain. My chain goes something like this:

Video-> CPU effects (about 5)-> opengl effects (about 20..switchable on or off obviously) -> split into 4 seperate quad warp meshes (for cornerpinning) -> out to videoplane

Thanks

Andrew Benson's icon

@laserpilot - The trick here is to capture the OpenGL object to a GL texture that is then sent through the slab chain. You can use the @capture attribute for this. This is similar to how slab works internally.

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

AB

laserpilot's icon

Definitely an ah-ha moment. I remember seeing stuff like this recently with your Scene Processing recipe, but didn't spend enough time with it. Additionally, i usually use the very helpful "clue" window to help me decode the multitude of messages that I can send these opengl objects and there is no clue for the capture attribute for some reason, although all of the others have one. I'll give this a shot, thanks!