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.
Page Index Toggle Pages: 1
lightning (Read 1166 times)
lightning
Jan 26th, 2010, 1:46am
 
I'm trying to create a generative lightning graphic.

I first tried simply taking point a and point b and stepping towards point b.

With each step towards point b, I would veer off to the right or left normal of the line towards b randomly.

This worked really well, creating a jagged yet focused line that looks electric (if you just jump the nodes about randomly, it stops looking like lightning). It's also quite important that I can target this lightning on a specific point.

But after looking at some tesla coil videos, I noticed that lightning branches off along its path.

What I would really be after is some kind of recursive algorithm, that headed towards my attractor, but also sent off recursive paths as it went.

Does anyone have any lightning examples they can point me to to help with my research? Preferably ones that may express this branching behaviour
Re: lightning
Reply #1 - Jan 26th, 2010, 3:32am
 
Not yet, but I like a challenge.  Wink Give me a while...

EDIT: Argh! This is not as easy as it sounds. I give up! I've had thunder trees so dense they look like upside down tornadoes, and bolts coming from points I didn't even know existed!

Here, go look at this instead:
http://www.openprocessing.org/visuals/?visualID=2924
Maybe it will inspire you.

"Thor I ain't!"
Re: lightning
Reply #2 - Feb 10th, 2010, 8:40pm
 
I've actually created a lightning generator that's based on real-life lightning physics, tweaked to a processing environment.

http://rdwong.net/archive/lightning/

If you play with it long enough, you can actually see that the lines don't actually branch off, but found a different/shorter path from point A to point B via electrons in the air. But because the change of path happens at such a great speed, (1/10000000000000zzz... seconds) it appears to be branching off. (I could be wrong here, it could just be that they really branch off when a couple of electrons find a shorter path. I'm no meteorologist.)

Hope it helps!
Re: lightning
Reply #3 - Apr 21st, 2010, 8:00am
 
That's a lovely sketch.  Turning on the particles really reveals the complexity behind what's going on, and yet all coded in very few lines.  Love it Smiley
Page Index Toggle Pages: 1