achieve this lightning effect

For questions about using Classic.

Post » Fri May 25, 2012 11:17 pm

Hi there,

I know there is already a lightning effect .cap example, but it doesn't work on dynamic angles (I think) and doesn't looks smooth like the following example:

http://blog.oaxoa.com/wp-content/examples/showExample.php?f=lightning_test5.swf&w=730&h=680

Is the math very complicated behind it? I can feel it has something to deal with sine and cosine. Don't want these sliders and adjustments, just the effect.

edit: just remembering this one from tulamide.
Maybe in some way, it's possible with this editor to create this effect.

edit2: just recognized, that there isn't a .cap from the editor^^zyblade2012-05-26 10:24:20
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Sat May 26, 2012 10:41 am

my guess is a 1D perlin noise combined with an offset polygonal line (see steps parameter). add a fancy glow effect and you're good to go.

if you set the speed pretty close to 0 one can see, that all arc-branches are kind of "aware" of another. it looks like the noise-function behind affects all branches at once, so more like 2D-noise.
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Sat May 26, 2012 10:48 am

Thank you, looks like a good idea, but I hadn't worked much with perlin(bad me ><). But maybe I get something interesting while trying it out^^.
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Sat May 26, 2012 11:02 am

This isn't much, but it's something xD
Didn't use perlin yet, but well....
http://dl.dropbox.com/u/26932498/crazy_line.cap
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Sat May 26, 2012 5:21 pm

Don't really see the need for perlin.
http://dl.dropbox.com/u/666516/lightning.cap

Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sat May 26, 2012 5:27 pm

Really nice solution. I'll look for a few tuts for displacement, as I never really understood it^^. Just need little improvements for the thickness. Thank you newt.
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Sun May 27, 2012 2:17 am

@newt: simple, but random. and it makes use of displacement, which is limited in resolution/steps. what did you advise, 60 polys or so?

@zyblade: if you really want to have that look, you had to create instances of line objects (maybe 5x5px or 3x3px sprites would be better considerung aa issues) and move/scale/rotate them via perlin as needed. that would be step/resoultion independent.
B
59
S
7
G
2
Posts: 93
Reputation: 4,228

Post » Sun May 27, 2012 2:54 am

Hardware limitation is about 60x60, but there's not much reason to have as many rows as columns, 1 is fine. In which case you can go much higher in columns.
I don't really suggest that though. Just divide the distance into equal parts that you are comfortable with.
Also no reason you can't have multiple instances of the distortion.
newt2012-05-27 02:55:07
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Sun May 27, 2012 10:26 am

Thanks for your replies,

@oppenheimer I'll already try that with the line object too, but it's proceeding slowly^^ If you don't mind, you could come up with a .cap.

I looked a bit deeper into my first link. There are lines, connected to points, that are moveing relative from the last point up and down(if the last point got a little lower, the next (can) get even lower now until the main cap). And the points are even spread on the line(.width) how long it ever would be. And with at least 30 points, it looks very smooth. But I don't know (yet) how to replicate it because I don't know how to connect them relative to each other yet^^zyblade2012-05-27 10:37:54
B
24
S
9
G
2
Posts: 294
Reputation: 3,160

Post » Sun May 27, 2012 10:46 am

For lines the method you would want to use is generate the random value to a variable, then use that variable for the end point, and also for the next start point.... generate random value to variable, etc.

Also you might try Davids Ribbon object. It might be easier to use with distorts.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests