HOME | DD

wonderwhy-ER — Flow 1.1 by-nc-nd

Published: 2009-11-28 18:05:13 +0000 UTC; Views: 28633; Favourites: 228; Downloads: 285
Redirect to original
Description Original work and code
So I stumbled on this some work at wonderfl.net some time ago and wanted to play with the code. Seems it is a ported to AS3 from Processing experiments. Works pretty fast but it does not behave as good as I would like...

Changes I made to the code
Here first version. Did not do much. Made it bigger, added my FPS counter, changed drawing methods, made some optimizations and made it show 20K of particles instead of 6kin original, made it repeating (left side connected to right, top to bottom, particles reappear on other side of the screen when they leave it). Also added "time to live" to particles so that when it expires they reappear in other random place. This way no space is left without particles for long (something I did not like in original version).

Planing to play with it more adding some effects, colors, objects you can drag to stage (particle emitters, walls, constant pressure or speed fields) etc etc. Will see how it goes

Controls
Just click and drag to create wind.
Double click to restart.

Update 1.1
Added colors and blur effect, become little bit more heavy on CPU. Fixed little bug with particles kind of teleporting when crossing screen border at high speed.
Related content
Comments: 122

wonderwhy-ER In reply to ??? [2009-12-03 07:20:07 +0000 UTC]

Paldies

👍: 0 ⏩: 0

Darkdragon15 [2009-12-02 20:53:41 +0000 UTC]

Much better

👍: 0 ⏩: 1

wonderwhy-ER In reply to Darkdragon15 [2009-12-02 21:54:12 +0000 UTC]

Well in a way

👍: 0 ⏩: 1

Darkdragon15 In reply to wonderwhy-ER [2009-12-02 22:00:38 +0000 UTC]

👍: 0 ⏩: 0

axcho In reply to ??? [2009-12-02 20:53:18 +0000 UTC]

I think I liked the original, uncolored version better, actually. I wonder what it would look like if you colored the fluid instead of the particles, like Plasma Pong...

👍: 0 ⏩: 1

wonderwhy-ER In reply to axcho [2009-12-02 21:53:55 +0000 UTC]

Mmm I am thinking on making a DisplacementMapFilter based version for that. May be at weekends. Something closer to how my FireBending thing works... Only problem is that may be it will not be as good looking...

I kind of agree that version without blurry trails looks better. Later it will be for you to pick when I will add UI

👍: 0 ⏩: 0

Keydan [2009-12-02 20:42:38 +0000 UTC]

The's bound to be more place for inmrovement!

👍: 0 ⏩: 1

wonderwhy-ER In reply to Keydan [2009-12-02 20:51:11 +0000 UTC]

You mean I can do better? Visually not shore tough I do want to try something little bit different may be at weekends.
As for other improvements I do plan to add interface with different options like what cursor does, what effects are on, some numbers, may be some object placements.

👍: 0 ⏩: 0

JohnJensen In reply to ??? [2009-12-02 19:51:54 +0000 UTC]

Nice. How'd you do the motion blur?

👍: 0 ⏩: 1

wonderwhy-ER In reply to JohnJensen [2009-12-02 20:49:13 +0000 UTC]

Mmm. Not erasing particles from bitmap, just blurring them on each frame. It's not really motion blur but rather blur/fade thing.

👍: 0 ⏩: 1

JohnJensen In reply to wonderwhy-ER [2009-12-03 13:31:08 +0000 UTC]

By the way, do you know a good website with a lot of BitmapData tutorials that are helpful? I know the basics myself.

thanks = D

👍: 0 ⏩: 1

wonderwhy-ER In reply to JohnJensen [2009-12-03 14:41:07 +0000 UTC]

Mmm. Tutorials... Don't think so. But with sources of works I know one. wonderfl.net + beautifl.net first is one which hosts source code/swf/in browser compiler and seond one collect beautiful works from it. I found sources for this fluid math there

👍: 0 ⏩: 0

zemjendyw In reply to ??? [2009-11-29 19:59:41 +0000 UTC]

omg, whats this

👍: 0 ⏩: 1

wonderwhy-ER In reply to zemjendyw [2009-11-29 20:22:23 +0000 UTC]

Where?

👍: 0 ⏩: 1

zemjendyw In reply to wonderwhy-ER [2009-11-29 21:28:56 +0000 UTC]

the whole. it is great anyway. ; )

👍: 0 ⏩: 1

wonderwhy-ER In reply to zemjendyw [2009-11-29 22:56:43 +0000 UTC]

That question confuses me
And yeah fun thing

👍: 0 ⏩: 1

zemjendyw In reply to wonderwhy-ER [2009-11-29 23:02:23 +0000 UTC]

just never mind
XD

👍: 0 ⏩: 0

SophieHoulden In reply to ??? [2009-11-29 16:21:49 +0000 UTC]

SO DAMN COOL!

👍: 0 ⏩: 1

wonderwhy-ER In reply to SophieHoulden [2009-11-29 16:30:47 +0000 UTC]

yeah

👍: 0 ⏩: 0

Niallmeister In reply to ??? [2009-11-29 06:30:44 +0000 UTC]

Reminds me exactly of a small java experiment I saw somewhere a while back, almost exactly the same with some sort of alpha distance filter so the particles would light up more in groups like they were communicating

Impressive as usual.

👍: 0 ⏩: 1

wonderwhy-ER In reply to Niallmeister [2009-11-29 09:39:45 +0000 UTC]

Well considering ti has 20K particles such drawing effects would kill it

👍: 0 ⏩: 2

Niallmeister In reply to wonderwhy-ER [2009-12-02 19:30:44 +0000 UTC]

Well, I guess you lied! This update is bloody marvellous.

I'd love to take a peek at the code, is that a possibility?

👍: 0 ⏩: 1

wonderwhy-ER In reply to Niallmeister [2009-12-02 19:37:09 +0000 UTC]

I was speaking about blend modes and alpha channels effects. You mentioned it there. Such effects effect each separate particle drawing and make a huge impact on performance. Here I just used blur/color transform after drawing particles so it's performance does no not depend on particle count but screen size.

As for code. Well there is link to code I used as base for this thing. Not much changed since then. Little less math, some optimization changes, and using BitmapData instead of Graphics to draw and apply effects to. No other differences.

👍: 0 ⏩: 1

Niallmeister In reply to wonderwhy-ER [2009-12-02 19:39:20 +0000 UTC]

Ah, I see.

👍: 0 ⏩: 0

Niallmeister In reply to wonderwhy-ER [2009-11-29 09:42:50 +0000 UTC]

Yeah, I can imagine : P

👍: 0 ⏩: 1

wonderwhy-ER In reply to Niallmeister [2009-11-29 09:56:50 +0000 UTC]

👍: 0 ⏩: 0

axcho In reply to ??? [2009-11-29 04:28:28 +0000 UTC]

What I really want to add to this are ragdolls... Think it would work?

👍: 0 ⏩: 1

wonderwhy-ER In reply to axcho [2009-11-29 09:38:14 +0000 UTC]

Haha I always wanted to do the same. Like shaolin monks fighting and all the wind things around. would go well with your experiments too. And also elements manipulation games like say Avatar games would be cool

As for how possible is it I do not know yet... Need to experiment with it. Basically just need objects that effect grid back. I will probably try something like a ball with it

👍: 0 ⏩: 1

axcho In reply to wonderwhy-ER [2009-11-30 02:11:55 +0000 UTC]

Please do. It would be great to see, and play with.

👍: 0 ⏩: 0

axcho [2009-11-29 04:18:34 +0000 UTC]

Wow. Plasma Pong in Flash?

I wonder what this would look like in 3D...

👍: 0 ⏩: 1

wonderwhy-ER In reply to axcho [2009-11-29 09:35:18 +0000 UTC]

Plasma pong had a better model... I am not shore really what the difference but here pressure/speed field is kind of static, I mean that there are just speeds/pressure in a grid that adjust to their neighbors. In pong a better model was used where pressure and speeds kind of traveled based on speed or something It allowed things like traveling low pressure hurricane zones and stuff. Here it is not possible May be I should try finding code on which Plasma Pong was made and see if I can bring it to such speeds in AS3...

Hard to control in 3D... You need some 3D input device. Mouse is not enough...

👍: 0 ⏩: 1

axcho In reply to wonderwhy-ER [2009-11-30 00:40:30 +0000 UTC]

Hmm, but does the simplicity here make it faster? There are still a lot of cool things you can do with this - it *feels* realistic, even if it is missing certain behaviors.

As for 3D, I just think it would be really cool to be able to generate 3D smoke patterns and such, whether or not you can control it. Like this: [link]

👍: 0 ⏩: 1

wonderwhy-ER In reply to axcho [2009-11-30 07:17:51 +0000 UTC]

Hehe

👍: 0 ⏩: 0

CainDraka [2009-11-29 03:52:39 +0000 UTC]

Whatever this is doing to my brain, I like it
I wanna see this turn into a realistic water-stirring simulator or something

👍: 0 ⏩: 1

wonderwhy-ER In reply to CainDraka [2009-11-29 09:44:15 +0000 UTC]


As for what it is doing with your brain I can guess. Our brains like to learn new structures and patterns and such things as this has millions and all do look like there is some kind of pattern behind them
Well at least I feel good looking at it and trying to figure it out or something

👍: 0 ⏩: 0

pixelquarry In reply to ??? [2009-11-29 00:06:16 +0000 UTC]

That's very cool!

👍: 0 ⏩: 1

wonderwhy-ER In reply to pixelquarry [2009-11-29 09:38:25 +0000 UTC]

Hehe

👍: 0 ⏩: 0

Keydan In reply to ??? [2009-11-28 21:43:00 +0000 UTC]

And it doesn't even lag!

👍: 0 ⏩: 1

wonderwhy-ER In reply to Keydan [2009-11-28 23:03:38 +0000 UTC]

Yeah Was amazed by original work at wondefl when I saw it

👍: 0 ⏩: 1

Keydan In reply to wonderwhy-ER [2009-11-29 00:51:35 +0000 UTC]

And it has practical use!

👍: 0 ⏩: 1

wonderwhy-ER In reply to Keydan [2009-11-29 01:04:34 +0000 UTC]

I hope

👍: 0 ⏩: 0

Apofiss In reply to ??? [2009-11-28 20:08:01 +0000 UTC]

amazing :]

👍: 0 ⏩: 1

wonderwhy-ER In reply to Apofiss [2009-11-28 23:03:54 +0000 UTC]

Yeah

👍: 0 ⏩: 0

SuperVitality In reply to ??? [2009-11-28 19:56:41 +0000 UTC]

If god had a son who was born with a talent for Adobe Flash; It'd be you

👍: 0 ⏩: 1

wonderwhy-ER In reply to SuperVitality [2009-11-28 23:02:45 +0000 UTC]

Well that is a confusing compliment... Tough I do not deserve much credit. Original authror of Processing thing is + this probably japanise guy who ported it to AS3 at wonderfl should have majority of it.

👍: 0 ⏩: 1

SuperVitality In reply to wonderwhy-ER [2009-11-29 08:38:00 +0000 UTC]

Still awesome

👍: 0 ⏩: 0

muffaelucciole In reply to ??? [2009-11-28 19:40:20 +0000 UTC]

impressive... as usual...
: )

👍: 0 ⏩: 1

wonderwhy-ER In reply to muffaelucciole [2009-11-28 23:03:11 +0000 UTC]

Thanks

👍: 0 ⏩: 0

Donitz In reply to ??? [2009-11-28 19:08:22 +0000 UTC]

Amazing. I had no idea you could get this kind of performence from flash. Sweet!

👍: 0 ⏩: 1

wonderwhy-ER In reply to Donitz [2009-11-28 22:54:00 +0000 UTC]

I did not too Tough much of credit should go to Processing thing author and this Japanise guy who ported it to Flash.

👍: 0 ⏩: 0


| Next =>