Skip to content

Conversation

yomboprime
Copy link
Collaborator

@yomboprime yomboprime commented Dec 8, 2018

Support to create lightning strikes and other voltaic arcs, animated in time.

These are 3 examples in one html, and two new classes:
THREE.LightningStrike is a BufferGeometry which varies over time (a call to .update( time ) is needed) Rays can have a limited lifespan or can be 'ethernal'.
THREE.LightningStorm is a higher class object, easy to use and drop-in as a storm in a game. It creates rays on its own over time. (Also needs .update())

The two classes are created with parameter objects (details in the file headers). You can define some 'callbacks' to control the form of the rays, do something when a ray hits the ground, and other things.

Edit: Also the rays have a read-only state, so you know each phase of the life cycle including propagation and vanishing.

Time can go forwards and backwards, be slowmotion, etc.

I had the need to do this for some time. 😊

@looeee
Copy link
Collaborator

looeee commented Dec 8, 2018

For testing: https://raw.githack.com/yomboprime/three.js/storm/examples/webgl_lightningstrike.html

Working nicely on my Moto G6 👍

@yomboprime
Copy link
Collaborator Author

@jsantell
Copy link
Contributor

Heh, pretty cool 😄

screenshot from 2018-12-10 10-50-25

@mrdoob mrdoob added this to the r100 milestone Dec 31, 2018
@mrdoob mrdoob merged commit 78b5041 into mrdoob:dev Dec 31, 2018
@mrdoob
Copy link
Owner

mrdoob commented Dec 31, 2018

Thanks!

@yomboprime yomboprime deleted the storm branch January 6, 2019 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants