gSkinner - Home

Flash 8: Webcam Snowstorm

Posted on August 15, 2005 by Grant Skinner

I’ve been playing a lot with Flash 8′s bitmap features in conjunction with webcams, and will be releasing a few of the resultant experiments over the next week or so. The first of them is pretty simple, though it took some tweaking to get right.

This experiment simulates a snowfall with 400 snowflakes on screen, each with random size, rotation, speed and blur (using BlurFilter). Each of them is independently affected by wind (as partially controlled by your cursor’s x position). That Flash can run it all fluidly is impressive in itself, but of course there’s more. It’s also monitoring the webcam input, detecting edges, and making the snowflakes settle gently on any horizontal surface they encounter – pretty cool.


I’m achieving this with a combination of convolution, horizontal blurring, color adjustments, thresholding and pixel sampling. It’s relatively processor intensive with 400 flakes, but it runs at the full 30 fps on my G5.

You can see the experiment below. If you don’t have a webcam, you can still see the snowfall, and I’ve appended a picture of it in action below. If you do, try playing around with it – one of the neatest things I think is to let some snow pile up on your head or shoulders and then brush it off with your hand… virtual dandruff! Note that it obviously works best with adequate lighting, and good contrast (ie. your white shirt against a white wall won’t gather any snow).

Requires Flash Player 8. If the snow isn’t sticking to edges, you probably have an older player.

Also check out Gallery Incomplet (incomplet.org) for other Flash experiments. [Note: moved to incomplet.gskinner.com]

Here’s a sample image for those of you without webcams:

Another image, I just liked the way the snow piled up on the graphics on this shirt:

Follow @gskinner on Twitter for more news and views on interactive media.
83 Comments

Wow, that is very, very cool. I've just had a load of people grow snow eyebrows and 'taches!

Posted by: Paul Neave on Aug 15, 2005 11:29am URL: http://www.neave.com/

amazing!

Posted by: Valters Boze on Aug 15, 2005 11:37am URL: http://www.djnet.lv

Cool stuff, reminds me of this:

http://www.setpixel.com/content/?ID=snow

Posted by: ghopper on Aug 15, 2005 12:14pm URL: http://none

It's not fair - I want to play with the new flash too :(

I wnow I probably could with mtasc and stuff but it's not the same.

Anyway, some really good work here, just the sort of stuff I was planning to do with processing but I might hold on now.

Posted by: Jon B on Aug 15, 2005 1:31pm URL: http://www.scrwd.com

HI. are you using using cache bitmap to achieve the speed with bitmaps? Most of the docs talk about vector and cache bitmap but the speed increase also works with png's..etc is that true?

Posted by: ian on Aug 15, 2005 1:39pm URL: http://www.mrgamechef.com

ghopper - while it's visually similar, it's totally different functionally, though I've been working on some similar concepts... I'll have to take a closer look at what he's been doing to see if it gives me any inspiration.

ian - the snowflakes are radial gradients, which are cached as bitmaps because of the blur filter that is applied to them. I'm not sure if caching a PNG in an MC would increase performance, I would guess not, but it's possible that it would increase it very slightly due more to scoping than anything else.

Posted by: Grant Skinner on Aug 15, 2005 1:53pm URL: http://gskinner.com/

That's awesome grant. I like how when I move the CAM the snow flakes "fall off". I got snowed on finally, too bad it doesn't snow in LA... :)

Posted by: Ivan on Aug 15, 2005 8:05pm URL: http://www.blitzagency.com

Flash 8: Webcam Snowstorm

Flash 8: Webcam Snowstorm: "I've been playing a lot with Flash 8's bitmap features in conjunction with webcams. This experiment simulates a snowfall with 400 snowflakes on screen, each with random size, rotation, speed and blur. That Flash can run it all

Posted by: BLOGGY on Aug 17, 2005 5:13am URL: http://mike-wilson.net/blog/index.php?/archiv…

That rocks! Nice work!

Posted by: Zok on Aug 25, 2005 3:55am

It's Great!!!

Awesome!

Posted by: Japerman on Aug 25, 2005 6:17am URL: http://www.slaveofthemind.com

Got webcam?

Got webcam? If you do, and have the beta Maelstrom Player, then Grant Skinner has something which would blow the minds of anyone slaving in other web technologies... yeah, it's all a bit of a snow job, but still.... ;-)...

Posted by: JD on MX on Aug 25, 2005 3:38pm URL: http://weblogs.macromedia.com/jd/archives/200…

man that's really cool

Cheers

Posted by: Igor on Aug 29, 2005 7:29am

wonderful...

Posted by: dudu on Sep 15, 2005 4:31pm URL: http://www.academia.nu

Hi

Yeaaah that is really innovative... Is the source public available ?

Best

Posted by: Igor on Sep 24, 2005 6:02am

its amzing+irrestible.its an unimaginable stuff by sumone who is really vry vry gr88888888888888888 CREATOR in my eyes!

hope i get to sit besides one of thm-ONE DAY!!!

Posted by: RaajiKhanna on Sep 29, 2005 3:41pm

Looks great! I had to put on an extra sweater to stand the imaginary cold!

Posted by: RedDragon on Oct 13, 2005 1:59am URL: http://www.spiritz.nl

this is totally cool, is the source available somewhere??

Posted by: Robert on Oct 20, 2005 4:09am

in one word: Wow!

Very inspiring. Seems you have already a lot of experience with all those new flash features.

Do you think it's posible to create Eye-Toy games? in other words, do you think the flash actionscript interpreter is quick enough for more complex eye-toy pixel calculation?

Keep up the good work - Marco

Posted by: Marco on Nov 7, 2005 1:23am

Grant, very good work man.

Always impressed with the type of stuff you come up with keep it up!

Posted by: Eric on Nov 7, 2005 11:40am URL: http://www.ericchan.ca

That looks great, cant wait til next week for Spark, the ideas will be flying around my head (just have to find the ways of getting them on screen then!)

Posted by: Craig Goodwin on Nov 8, 2005 5:10am

hmm i have an isight/mac but can't get my camera to work in the browser - what's the trick?

Looks awesome!

MacBoy

Posted by: mac boy on Nov 15, 2005 3:18pm

yep, I also have a mac and have been trying to find out how to make my EyeToy work as a webcam, but I can't find anything! Can you help me?

Thanks!

Bekky

Posted by: Rebecca on Nov 19, 2005 10:47pm

just right-click on the flash, choose settings, then go to the camera tab (bottom) and choose the correct cam.. hope it helps..

xa4

Posted by: Xavier Righetti on Nov 24, 2005 11:18pm URL: http://xa4.ch

would this work with any instant messengers ?

Posted by: john cranford on Dec 7, 2005 2:32pm URL: http://www.sawifi.tk

This looks awesome, you are realy good! Would love to have that on my site... http://www.onmywebcam.com wow what i nice thing... Love it!!!

Posted by: Aesome on Dec 10, 2005 2:07pm URL: http://www.onmywebcam.com

I'm a bit confused. I get the concept and I do think it's great, but all I see is the snow itself and no webcam picture (Yes, I have a webcam!). I have Flash 8 installed and I've tried in both Firefox and Internet Explorer (On a sidenote, the snow looks sharper in IE than FF)and my webcam isn't displaying. I've also tried reselecting my webcam from the settings options.

Any thoughts?

Posted by: Neil on Dec 13, 2005 7:47am URL: http://www.theworkof.co.uk

Very nice effect...

Posted by: Chris on Dec 19, 2005 6:55pm URL: http://www.csimagedesign.com

doesn't work with video feed from within max os/x, safari.... seems to work fine on other browsers though.

Posted by: onebitpixel on Dec 20, 2005 10:30am

It was tested fully in Safari. Be sure you have the right video source selected:

- right click on the Flash movie

- choose Settings...

- click the webcam icon

- choose the appropriate video source (ex. an iSight is IIDC Firewire Video)

Posted by: Grant Skinner on Dec 20, 2005 10:53am URL: http://gskinner.com/

Is there any way to blend this with a current flash animation, i would love this to work with my site??

Like to have the snowflakes fall on the letters in the animation? Has anyone tried it?

Posted by: Jacob on Dec 20, 2005 6:11pm

oh!!! it's a REAL FUN :)

Posted by: Nek on Dec 27, 2005 8:11am

Looks awesome!

Posted by: fermuar on Jan 18, 2006 12:49pm URL: http://www.zile.gen.tr

ike to have the snowflakes fall on the letters in the animation? Has anyone tried it?

Posted by: http://trlist.gen.tr on Jan 20, 2006 4:50pm URL: http://trlist.gen.tr

is there anyway for interactions with webcam and buttons in flash?

Posted by: eski on Mar 8, 2006 11:56pm

This is just GREAT !

Posted by: phrEEk on Mar 13, 2006 1:02pm URL: http://www.hecatonta.com

man, just a few months ago i tried flash and my webcam and everything worked fine. then i plugged my webcam in recently and tried to use it with flash but it's no longer displaying video and the currentFPS reported is 0.

my webcam works on msn and with a little video capture program i wrote in python, so i don't understand why flash is not working. anyone have any ideas?

Posted by: robert on Apr 18, 2006 2:39pm

Wow, that is awesome. I am working on a experimental Flash 8+webcam project and was wondering if you have time to check it out (www.alivebroadcast.com). Alive Broadcast is a web based service that allows you to save webcam images directly to the server, and then share them anywhere on the web. Thanks

Posted by: andreit on May 16, 2006 9:07am URL: http://www.alivebroadcast.com

Hi

thank you its very useful for me :)

Posted by: Diviner on Jun 18, 2006 4:20am URL: http://diviner.blogspot.com/

Nice... Very nice effect...

Posted by: Con-Verse on Jul 18, 2006 3:49pm URL: http://www.con-verse.fw.hu

Saw the fire one, and I think the fire one look better! The snow effect is cool too but personal preferences!

Posted by: FGS on Jul 27, 2006 9:25am URL: http://www.flashgamecript.com

There goes my productivity for the next hour... this is just too fun :)

(worked flawlessly with my Macbook pro)

Posted by: Pedro Melo on Aug 24, 2006 4:12am URL: http://www.simplicidade.org/notes

can this be used on msn when my grad kids are looking at me would be cool they will think its snowing here on me

Posted by: rick on Dec 3, 2006 4:20pm

my like

Posted by: amanda on Dec 16, 2006 11:54am

It's realy COOL!!!!!

Posted by: Alex on Dec 23, 2006 8:46am URL: http://www.construction-tools.info/

djdjjjdpdsd comme sa

Posted by: merde on Jan 10, 2007 12:21pm URL: http://azerert

I am working on a project that will be going over to prague this summer (http://www.pq.cz/07/stred_basicinfo2.html) and your winter snow example is exactly the type of effect that we would like to create. Currently we are using Flash 8 along with a maxMSP/jitter to produce this real-time performace...would you be able to provide the source code, or file itself?

Thanks

Posted by: matt on Jan 24, 2007 7:22pm URL: http://na

Awesome !

Posted by: car0line on Feb 9, 2007 2:20pm

....

Posted by: g on Apr 10, 2007 4:13am

Hi there I am looking for the actionscript for ghostly mirror see http://www.setpixel.com/content/?ID=ghostlymirror. Can anyone help??

Thanks

Posted by: Emma Chapman on Apr 12, 2007 7:18am

Hi there, working on a final year uni project - wonder if you could help us with accessing the code for this type of project/motion tracking?

Nice work, thanks.

Posted by: Jenni on Apr 12, 2007 9:42am

hey i love this its so cool would you be able to email me the scorce code for this it would be much appreceated thx

sry for my spelling

Posted by: David on May 5, 2007 10:17pm

Cool!!! Ilike FLA file

Posted by: Jack Sparrow on May 30, 2007 10:38am

Great stuff!

Posted by: John on Jun 7, 2007 6:32pm URL: http://www.iwantto.us

Amazing!

Posted by: fosk on Jun 22, 2007 12:07pm URL: http://www.fosk.it

hey, that is cool.

check out some of mine:

http://members.westnet.com.au/lmwan/projects.html

Posted by: Marcus Wan on Jul 3, 2007 7:48pm URL: http://members.westnet.com.au/lmwan

Just amazing

Posted by: Platfuse on Jul 13, 2007 9:04am URL: http://www.platfuse.com

Hi it's really cool! Damn good try!

Posted by: Kathir on Jul 17, 2007 10:24pm

Hi... i need help.. how can i do a flash project that take streaming from mine cam and shows it for others?

comtakt me by my mail if you know any answer or have links who can help......

my email:

Apolio_Diablo@hotmail.com

Posted by: Micael Svensson on Sep 3, 2007 4:12pm

was wondering if you are able to provide the source code? =) well, is amazing. =)

Posted by: yan on Sep 17, 2007 10:59pm

c'est de top se jeux

Posted by: levent on Sep 22, 2007 5:50am

ya pas mieus lui qui di que sait nule il se tronpe

Posted by: levent on Sep 22, 2007 5:52am

I am gobsmacked! THIS is really impressive. Snow all over me, and I'm in front of a blazing fire!

Posted by: Don Slaven on Oct 8, 2007 11:44am

Great work, very nice effect.

Very impressive.

- Cheers for sharing it with us.

Posted by: Alin on Oct 19, 2007 1:35am

Salut

Posted by: Dupont on Oct 24, 2007 5:06am

GREAT !!!!!!! I felt from my chiar !!! ;) VERY VERY Impressive !!!!!!!!!!!!!

Posted by: Demian on Nov 1, 2007 9:40am URL: http://beed.co.il

is the source or the fla available??

Posted by: roadking5 on Nov 12, 2007 2:14pm

I WOULD LIKE A COPY OF THIS FOR A BACK DROP IN A WEDDING?? ANYWAY I CAN GET OE IN DVD FORM?

Posted by: lisa garbiel on Jan 28, 2008 5:35pm

I WOULD LIKE A COPY OF THIS FOR A BACK DROP IN A WEDDING?? ANYWAY I CAN GET OE IN DVD FORM?

Posted by: lisa garbiel on Jan 28, 2008 5:36pm

c'est nul je prefair celui avec les flames

Posted by: mattéo on Mar 21, 2008 10:48am

Is there a way of setting the camera quality, I've tried doing this and although my quickcam sphere/orbit will do a higher resolution, is it correct to say that you can't see the higher quality locally unless you're connecting to a bona-fide flash communication server?

Posted by: Derek Foley on Jun 26, 2008 8:37am URL: http://www.derekfoley.com

do you have more simulations like that??

Posted by: Dannick on Aug 28, 2008 12:35pm

Very cool, I have a question? do you know how to set the camera feed higher

Posted by: akil on Sep 21, 2008 1:09pm URL: http://www.rezaakil.com

c est la bien

Posted by: mario on Apr 11, 2009 4:27pm URL: http://asde

Can you show me the source code?

Posted by: Josh on May 21, 2009 4:33am URL: http://www.shiningmorning.com/

Great effect!

Posted by: Posizionamento siti on May 28, 2009 4:01am URL: http://www.w3facile.com

Hi, this is cool

Can you by any chance help me?

All I want is to make my cam detect motion.

and if it does make it play a movie clip

I got the source of motion detection but don't know how to program it to play a movie clip and pause when motion isn't detected.

Posted by: ann on May 29, 2009 7:08am

it's very nice concept, once you control the detection of the camera you can do too many things with it...

for whom it didnt work with them, check your camera settings with the flash 8, it didnt work on my Mac laptop but it works on my HP laptop

regards,

Moustafa

Posted by: Moustafa on Dec 13, 2009 12:15am URL: http://moustafamezher.com

So cool,could you give me the source code, I want to learn it how to build up.

Posted by: LEE I JUI on Dec 16, 2009 12:21am

commen on fai

Posted by: laura on Feb 6, 2010 2:13pm URL: http://2011

trop mdr

Posted by: oceane on May 5, 2010 11:52am

can you please let me know its source code?

Posted by: Yasir on Jul 14, 2010 6:17am URL: http://www.phppalace.com

c'est malades on peux tout faire dans la maison avec de la neige !!!!!!!!!!!!!! LOL

Posted by: lorianne on Nov 27, 2011 1:11pm

je suis le boss

Posted by: jordan on Jan 22, 2012 5:04am URL: http://ghfodghj.com

Leave a Reply

Your email is never published nor shared.




You may use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">