fading out particles

s.rozsa's picture

i came across this problem while i was making some little demo compositions for Martin K. and the QC-TUIO plugin. I have built a basic MultiTouch particle simulation using an iterator and iterating a particle system for each touch (cursor). The problem is that the particles are disappearing suddenly (abruptly) once i have removed my finger from the surface. A smooth fade out would be here much more nicer. I understand that this has to do with the iterator (iterate when a finger is there - stop iterating that instance if the finger is removed).

My question: is there a simple way to make a particle system smoothly disappear inside of an iterator? It should be as simple as possible, since the composition is aimed to beginners (MT-beginners) and should be understandable..

Any help (maybe a small example??) is highly appreciated!

Cheers,

Sandor

gtoledo3's picture
Re: fading out particles

You may want to consider using an accumulator in there.

I can also think of a few other methods... but it's hard to say without seeing the comp. You can use blending/color to make stuff fade out, iterator setups themselves can help with certain fade scenarios. There are some decent developer examples of that stuff in the Quartz Composer developer examples folder, with pretty self explanatory names.

psonice's picture
Re: fading out particles

I'd say use a smooth patch to smooth the "touch" signal - i.e. instead of a touch being on/off, after the smooth it will fade from 1 to 0 over say 1 second after the touch is released.

Then, use that value to control the alpha value of the particle colour - it should fade out nicely. QC considers a value of >0 to be "on", so it should still remove that particle system once the fadeout has reached zero.

gtoledo3's picture
Re: fading out particles

Aha, the example I was referring to, and which also shows a well formed example of what psonice mentions is in Developer/Examples/Quartz Composer/Compositions/Interactive/Fade Smoothly - Javascript.qtz

... this one uses a javascript integrator setup that's neat; what psonice mentions about the smooth is a really good route as well.

s.rozsa's picture
Re: fading out particles

yeah guys, that's what i was looking for. The smooth fade-out what psonice mentions is i think the best thing. I have fiddled with that idea for a while but was getting only a very complex looking non convincing spaghetti salad out of QC...

Anyhow: here's the the file without any smoothing. You can throw out the TUIO stuff and use the mouse in case you are not used to work with the TUIO thingies... If the particle stuff is working INSIDE the iterator with the mouse it should be ok for TUIO i think...

Would be very nice if one of you guys could take the time to do that demo... Apparently i'm too dumb to make a simple solution for this - so I appreciate that highly ;-)

TIA,

Sandor

PreviewAttachmentSize
TuioParticles.zip14.02 KB

gtoledo3's picture
Re: fading out particles

Hmmm.... ok, I tried this with the simulator in "objects" mode. See if this works for you, I imagine it should, as I've done similar setups before.

If you end up using this particular fade setup for an example, co-credit please, as a feel the solution of keeping one iteration active is mildly novel :o) No other remuneration necessary. Feel free to ask more if this doesn't work for your setup...

I have to admit... for whatever reason TUIO hasn't punched my button too much, but it's kind of piquing my interest more. I think the ideas you are working on with your website are cool, and I've been working on extremely similar ideas... just mostly working with camera tracking type ideas instead.

[Note, I did have a crash happen while working on this from doing a save a copy as while the TUIO was running, then opening it up (without running it)- I think this is the glitch that turned me off a bit a looong time ago. It's weird- some glitches I am way forgiving of, but that one is irritating!]

PreviewAttachmentSize
TuioParticles GT MOD.qtz20.27 KB

gtoledo3's picture
Re: fading out particles

As an addendum... messing with this now, it doesn't work right. Adding the iteration throws off the x/y...

Does the original composition work as expected on your system? The tracking is inverted in y on mine... and is skewed a bit "off".

s.rozsa's picture
Re: fading out particles

Hey George,

first off: thank you VERY much for your efforts and the help. Surely i will give credit if i'm using pieces of your code ;-)

I am attaching the latest version of my composition. It is woking very good excepting that "fade out" function. I just realized, that you are still using the old version of the TUIO plugin. That is why your "Y" is inverted and why the coordinates are messed up. The new version of the TUIO plugin is also much more stable and there is no more crashing if you open up more than one composition using the TUIO plugin. The new version should be officially (pre)released very soon by Martin - though the actual source is accessible at sourceforge - but please drop me a mail at rozsa@cd-cologne.de for the current binary...

Just did a quick run with your composition - as you are saying in your addendum, it does not working as expected/hoped. Only the "artificial" iteration will be smoothed out. Also this "artificial" instance is not associated to the provided x/y TUIO coordinates. Inside the iterator you are also using some smoothing values - they don't work at all - you have to bypass them to use the TUIO x/y values...

BTW: i was messing around in the past with some similar stuff with a timed signal. That is working nicely but i was not able to use it in iterated compositions (and believe me: i did a lot of spaghetti-salad trying to solve the problem... LOL). I think the challenge is to keep the particle system active even if the "touch" is removed - so a timed/stored signal is maybe necessary...

What do you think?

PreviewAttachmentSize
TuioParticles.zip14.02 KB
fadetest.zip2.71 KB

gtoledo3's picture
Re: fading out particles

I haven't checked this out yet, but I remember about 10 min after cursing my realization that the iterator trick didn't work thinking that I should have just set it up with an accumulator background to create a fade, like my first instinct.

I still promote that idea in lieu of structure massaging... I mean, the whole nature of the accumulator patch screams out to be used in a situation like this.

s.rozsa's picture
Re: fading out particles

Hey George,

sorry - i'm not sure if i understand your posting right... Are you proposing to put the iterations in a render to image patch and than use the image accumulator patch? If so: i have made some small experiments with that, but i don't see how i could use that with the particles... But maybe i'm completly wrong (sorry for the ignorance - but my english is not really good...)

EDIT: the new TUIO patch is now online over at www.tuio.org...