Sign in to follow this  
deffer

Lightning structure

Recommended Posts

Hi. What I want to do is a lightning effect. I'm not interested in visualization right now. Rather in it's overall shape. A lightning has, of course, a (binary) tree-shaped structure. I have a hard time trying to determine some general strategy for randomly creating it. I mean, lenghts of it's branches, directions. I think, there have to be a main path, and some sub-paths, coming one by one from tree nodes. But it looks rather simple and not interesting. Has anyone been doing this before, or can give any links to the theme? As usual, any ideas appreciated, no matter how little. /def

Share this post


Link to post
Share on other sites
You could actually simulate the electrical charge, to some degree. Generate opposite charges from above and below, and start stepping down randomly, leaning towards the path of least resistance. The link below might be a good place to start. Hope this helps.

As an aside, is this for a skymap effect or an actual 3D implementation?

howstuffworks: lightning

Share this post


Link to post
Share on other sites
Thanks, guys.

joanusdmentia:
The L-system seems to be too "unstable", meaning that the effect grows in a quite unpredictible way. Secondly, it is too much pattern-like.
However, they (www.ambientdesign.com/gallery-lightning.html) claim they modified it and seem to have nice results.

MdLeadG:
Simulating the leader's steps (main branch) is the actual problem here. So it is one step ahead of the article you suggested.


And yes, it is for an actual 3D implementation. For a lightning spell. What I need to find is some equation to determine behaviour of a single branch, or for splitting a branch. My previous experiments don't look too good.
I will bring a screen tomorrow, so you could see exactly what I mean.

Cheers.
/def

Share this post


Link to post
Share on other sites
L-Systems need a fair bit of tweaking. However, if it's for a realtime effect, I wouldn't use them. To what extent does it need to be animated? Real lightning isn't of course, but do you want this for your spell?

Share this post


Link to post
Share on other sites
So here's the shot of what I've managed to do already:

rainbow.mimuw.edu.pl/~mw209304/other/lightning.gif

And yes, it is for a real time effect. Graphic implementation is irrelevant at the moment. It's just for an algorithm Idea.

/def

Share this post


Link to post
Share on other sites
It looks unrealistic because, even though you've got branches coming off (too many in my opinion for the width of the bolt) the connecting sections are too straight.

Anyway...

A lightening bolt is both a path of minimal resistance and a random walk through the atmosphere. Much of its visual shape is dependent on the circulation of ionised air at the time of the strike. If you want a realistic looking bolt you're going to need to consider these things (or something that approximates them).

Personally, I'd go with a probabilistic path generator with determinstic biases and a random bolt-split function.

Cheers,

Timkin

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this