Lightning structure

Started by
5 comments, last by Timkin 19 years, 5 months ago
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
Advertisement
L-systems tend to be a good way of generating natural tree-like structures, I'd imagine it would work well for lightning as well.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V
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
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
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?
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
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

This topic is closed to new replies.

Advertisement