Skip to main content
Cian Code
  1. Posts/

Particles

·1 min

Particles

Crowd sensing road quality for optimal bicycle routing

Interactive Demo

Particles

Each particle has its own: #

  • Color
  • Size
  • Mass
  • Density
  • Elasticity (Coefficient of Restitution)
  • Surface Area
  • Lifespan

Collisions were modelled for: #

  • Walls and the roof(if On)
  • With other particles
  • All collisions took the radial distance from the particle center taking it’s individual Coefficient of Restitution and mass into account.

Two main forces were accounted for: #

  • Gravity for various Planets, F = M*G
  • Friction with various mediums (Drag), F = 0.5*C*p*A*V2

Controls: #

  • Clicking places a “Launcher” Draging changes particles initial velocity
  • SpaceBar, ‘M’ or Menu Button key shows/hides menu
  • ‘P’ pauses the movement of the particles
    • Ctrl/CMD to toggle grabbing mode (or clicking “Grab Off/On” if on mobile)
    • Click and Hold on particle to grab it
    • Drag to move it and collide it with other particles
    • Release to throw

Sound: #

  • Popping sound when particles die
  • Bouncing sound when particles have a collision with volume proportional to magnitude of collision

Github Source: #

github.com/cianmce/particles