Skip to content

mrgoonie/three.confetti.explosion.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

three.confetti.explosion.js

The confetti explosion effect based on THREE.JS GPU Particle System

Live demo:

https://mrgoonie.github.io/three.confetti.explosion.js/

alt text

alt text

How to use:

Include the plugin's javascript file: <script type="text/javascript" src="../dist/three.confetti.explode.min.js"></script>

Create a particle system:

var confetti = new ExplosionConfetti({
	rate: 1, // percent of explosion in every tick - smaller is fewer - be careful, larger than 10 may crash your browser!
	amount: 200, // max amount particle of an explosion
	radius: 800, // max radius of an explosion
	areaWidth: 500, // width of the area 
	areaHeight: 500, // height of the area 
	fallingHeight: 500, // start exploding from Y position
	fallingSpeed: 1, // max falling speed
	colors: [0xffffff, 0xff0000, 0xffff00] // random colors
});
scene.add( confetti.object );

Also in render function:

function render(){
	...
	if(confetti) confetti.update();
	...
}

Remove:

confetti.dispose();

That's it!

About

The confetti explosion effect based on THREE.JS GPU Particle System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published