Particle System

初出 1983 · William Reeves — William Reeves, "Particle Systems" (SIGGRAPH 1983). · 年表 ↗

発明者による命名 名称 · 命名 William Reeves (1983) — 著者による記述的命名。Reeves の 1983 年 SIGGRAPH 論文題「Particle Systems」。

ひとことで 速度・寿命を持つ多数のパーティクルを更新・描画する汎用フレームワーク。Boids や flow-field の上位概念にあたる。

Particle System · Open in new tab ↗ · Motion begins only when you press Run.

コード

上のデモの実際のスケッチ(サンドボックスで再現可能)。これで全部です。

particle-system/index.html
const SEED = Math.floor(Math.random()*1e9);

let particles = [];
let attractors = [];

function setup() {
  randomSeed(SEED);
  const s = Math.min(windowWidth, windowHeight);
  createCanvas(s, s);
  background('#0a0a0a');

  // Particles with velocity/lifetime, pulled toward a few attractor points.
  const N_ATTR = 3 + Math.floor(random(3));
  for (let i = 0; i < N_ATTR; i++) {
    attractors.push({ x: random(width * 0.2, width * 0.8), y: random(height * 0.2, height * 0.8) });
  }
  for (let i = 0; i < 1200; i++) {
    particles.push({
      x: random(width), y: random(height),
      vx: 0, vy: 0,
      life: random(150, 350),
      hue: random(360),
    });
  }
  colorMode(HSB, 360, 100, 100, 100);
  noStroke();
}

function draw() {
  // Faint trails by drawing a translucent black rectangle each frame.
  fill(0, 0, 0, 8);
  rect(0, 0, width, height);

  for (const p of particles) {
    for (const a of attractors) {
      const dx = a.x - p.x;
      const dy = a.y - p.y;
      const d2 = dx * dx + dy * dy + 50;
      const f = 24 / d2;
      p.vx += dx * f;
      p.vy += dy * f;
    }
    p.vx *= 0.98; p.vy *= 0.98;
    p.x += p.vx; p.y += p.vy;
    p.life--;
    if (p.life <= 0 || p.x < 0 || p.y < 0 || p.x >= width || p.y >= height) {
      p.x = random(width); p.y = random(height);
      p.vx = 0; p.vy = 0;
      p.life = random(150, 350);
    }
    fill(p.hue, 80, 95, 75);
    circle(p.x, p.y, 1.6);
  }
  // Hide attractors for cleaner look (uncomment to see):
  // fill(0,0,100); for (const a of attractors) circle(a.x, a.y, 6);
}

デモのソースを開く ↗

仕組み

各粒子が状態(位置・速度・年齢・色・サイズ…)を持つ配列を管理し、毎フレーム:(1) 放出=1 つ以上の発生源から初期値(多くは範囲内乱数)で新粒子を生成、(2) 更新=各粒子に力(重力・抵抗・フローフィールド・引力/斥力)を積み上げ、速度→位置を積分し加齢、(3) 除去=寿命切れや画面外を削除、(4) 描画=点・スプライト・過去位置の軌跡で描く。見た目は力と放出規則で決まり、力関数を差し替えるだけで同じエンジンが煙・火花・群れ・フローフィールド作品になる。

パラメータ

系譜

先行例
Karl Sims
関連
Boids / Flocking、Physics Simulation、Spring-Mass / Verlet

よく組み合わされるアルゴリズム

このアルゴリズムを使う作品 (63)

36 Points
sage-jenson
Aether
mfx
Agenda Circling Forth
fairlight
Amoeba
last-even
Asterisms
falko
Attraction
jos-vromans
Axo
jiwa
Blitzgewitter
titan
Blóm
lucas-swick
Blooms
cory-haber
Bubble Chamber
jared-tarbell
Chain
leander-herzog
Cyber Cities
pxlq
D-D-Dots
tuplart
Democracity
generative-artworks
Drift
paolo-ceric
Electriz
che-yu-wu
Essenza
stefano-contiero
Fantasía
alejandro-campos
Fleur
anapet
Flows
ryley-o-eth
Gen 2
dca
Gravilux
scott-snibbe
Gravity 12
jimmy-herdberg
Gravity 16
jimmy-herdberg
hälo
p1xelfool
Hōrō
makio135
HyperHash
beervangeer
Lacunae
james-dalessandro
Latent Spirits
robert-hodgin
Letters to My Future Self
ryan-struhl
Low Tide
artem-verkhovskiy-x-andy-shaw
Magnetosphere
robert-hodgin
marfaMESH
harvey-rayner
Memories of Qilin
emily-xie
Mycelia
jmy
Naïve
olga-fradina
Non Either
rafael-rozendaal
Octo Garden
rich-lord
Organized Disruption
joshua-davis
Panspermia
karl-sims
Phototaxis
casey-reas
Pixel Noir
antoine-schmitt
Polychrome Music
rafael-rozendaal-danny-wolfers-legowelt
Pre-Process
casey-reas
PrimiDance
wuwa
PrimiEnd
wuwa
Process 18 (Software 3)
casey-reas
send/receive
snowfro
Space Debris [m'aider]
whalestreet-x-pxlq
Space Debris [ravaged]
whalestreet-x-pxlq
Space Debris [warning]
whalestreet-x-pxlq
Star Flower
ruben-alexander
Subscapes
matt-deslauriers
Synapses
chaosconstruct
Through Curved Air
jacob-gold
UltraWave 369
beervangeer
undead wyverns
hideo
Universe of Water Particles
teamlab
Valence
ben-fry

参考文献

最終更新 2026-07-16