Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shahramshakiba/particles-p06

Particles ⁞|⁞ Particles are small, individual elements that can be used to create effects like smoke, fire, rain, snow, stars, dust and etc... ⁞|⁞ ⚪Three.js
https://github.com/shahramshakiba/particles-p06

particles threejs

Last synced: 2 days ago
JSON representation

Particles ⁞|⁞ Particles are small, individual elements that can be used to create effects like smoke, fire, rain, snow, stars, dust and etc... ⁞|⁞ ⚪Three.js

Awesome Lists containing this project

README

        

# Laptop   _Particles_   threejs logo

### Bubbles  _Description_

> To begin with, it is important to note that, this project have been sourced from an exceptional `Three.js Journey` Course.


### 👤 Instructed by a _proficient_ and _expert educator_, _"Bruno Simon"_ .


### Introduction to Particles
- Particles are small, individual elements that can be used to create effects like ` smoke `, ` fire `, ` rain `, ` snow `, ` stars `, ` dust ` and other phenomena that involve many small elements interacting in a visually interesting way.

- Particles are often used to simulate systems where it would be _impractical_ or _inefficient_ to use traditional 3D models.
- The good thing with particles is that you can have hundreds of thousands of them on screen with a reasonable frame rate.
The downside is that each particle is composed of a plane (two triangles) always facing the camera.

### Why Do We Need Particles?
Particles are crucial in creating realistic and dynamic effects in 3D scenes. They help in:

1. _Simulating Natural Phenomena_ :
- Effects like rain, snow, fire, and smoke.
2. _Creating Visual Effects_ :
- Explosions, magic spells, and other special effects.
3. _Adding Detail_ :
- Enhancing the visual richness of a scene without heavy computational costs.




### How Particles Work in Three.js
In Three.js, particles are usually created using Points. A particle system involves:

### 1. _`Geometry:`_
- Defines the positions of particles.
~~~~ html
const particlesGeometry = new THREE.BufferGeometry();
const count = 5000;

const positions = new Float32Array(count * 3);

for (let i = 0; i < count * 3; i++) {
positions[i] = (Math.random() - 0.5) * 10;
}

particlesGeometry.setAttribute(
'position',
new THREE.BufferAttribute(positions, 3)
);
~~~~

### 2. _`Material:`_
- Defines how particles look (color, texture, size).
~~~~ html
const particlesMaterial = new THREE.PointsMaterial({
size: 0.01,
sizeAttenuation: true,
color: '#fdbc08',
});
~~~~

### 3. _`Points:`_
- Combines the geometry and material to create the particle system.
~~~~ html
const particles = new THREE.Points(particlesGeometry, particlesMaterial);
scene.add(particles);
~~~~


Eyes Feel free to delve into the code as it has been written in a straightforward manner for easy understanding.


> [!IMPORTANT]
>> ### It is crucial to grasp that Particles:
>> - In Three.js allow you to create stunning visual effects efficiently.
>> - By understanding the basic components—geometry, material, and points — you can build complex and dynamic particle systems to enhance your 3D scenes.
>> - Experiment with different properties and techniques to achieve the desired effects and bring your scenes to life.




Clapper Board   Simulate 20000 Prticles in a Wave pattern

https://github.com/ShahramShakiba/Particles-Threejs-p06/assets/110089830/392eff23-2b1c-4173-af68-c248666ced0b


***

## Man Detective Light Skin Tone Find me around the Web

linkedin logo
   

telegram logo
   

whatsapp logo
   

instagram logo
   

twitter logo