We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Creating a splashing raindrop
Page Index Toggle Pages: 1
Creating a splashing raindrop (Read 973 times)
Creating a splashing raindrop
Dec 27th, 2007, 5:28pm
 
Hello! I'm just thinking about a code to show a raindrop, splashing one some water surface. Anyone have done this so far and can give some advice? My first attemp was to create circles whicht getting bigger and bigger. To show nice color gradients, i made the circles out of many single dots.. maybe not the best way. Maybe its better to scale some vector graphics?? Im thankful for any advise..

greets
Re: Creating a splashing raindrop
Reply #1 - Dec 27th, 2007, 9:38pm
 
http://freespace.virgin.net/hugo.elias/graphics/x_water.htm

seems to be the first place people go to simulate water. It's quite a nice effect, if a little processor intensive.
Re: Creating a splashing raindrop
Reply #2 - Dec 27th, 2007, 11:18pm
 
Thanks for this interesting link! I hope to figure out soon how to rewrite this for Processing...

Or anyone has done this already? I found this http://bodytag.org/tp02/ on the web, seems to be the effect i want written in processing. But this is about 5 years old, code is no more accepted by the newer versions ;(


Greets
Re: Creating a splashing raindrop
Reply #3 - Dec 28th, 2007, 12:41am
 
tschiggi wrote on Dec 27th, 2007, 11:18pm:
Or anyone has done this already I found this http://bodytag.org/tp02/ on the web, seems to be the effect i want written in processing. But this is about 5 years old, code is no more accepted by the newer versions ;(


I wrote something similar in flash a while ago, but I cheated slightly.  As long as you've got a static background the technique I used is fairly simple.

I think I built it something like this :

You've got the solid background, then you've got an invisible masked layer that is slightly larger ( and maybe distorted I cant remember ) than the actual background.  Then you just overlay the 'drops' which allow you to see a slightly transparent version of the masked layer, and they look similar to what you've got there...

At least, I *think* that's how it was done, though I'm not sure that approach would work in processing.  You could always do something more complicated and distort the actual *image*.
Re: Creating a splashing raindrop
Reply #4 - Dec 28th, 2007, 2:06am
 
tschiggi wrote on Dec 27th, 2007, 11:18pm:
Thanks for this interesting link! I hope to figure out soon how to rewrite this for Processing...

Or anyone has done this already I found this http://bodytag.org/tp02/ on the web, seems to be the effect i want written in processing. But this is about 5 years old, code is no more accepted by the newer versions ;(


A quick scan of the source tells me it seems to be using a modified version of the technique in that URL I posted, with some bump-mapping.

I've just finished converting it to the current version of Processing and it's on my website at this address - http://www.piku.org.uk/drupal/node/36

I like the way Processing automatically loaded the "It used to work, now it doesn't" page when I tried to load the old code into it. The only bit of code that doesn't work is the blending between backgrounds, and I think the constants for the water might need changing as it goes a bit too ripply after a couple of seconds.
Page Index Toggle Pages: 1