Physics Simulation
生成芸術におけるリアルタイムの粒子・布・ソフトボディのシミュレーションは、Verlet 積分(ルー・ヴェルレ、1967)などの数値積分や後年のゲーム物理の実践に基づく。単一起源ではなく広い技法の窓。
コミュニティ・通称 名称 — 命名・エポニムではなく記述的なカテゴリ名。用語の単一の命名者は確認されていない。
ひとことで Verlet 統合・剛体・流体など物理シミュレーションをアートの主要な駆動装置とする。
コード
上のデモの実際のスケッチ(サンドボックスで再現可能)。これで全部です。
physics-sim/index.html
const SEED = Math.floor(Math.random()*1e9);
// Rigid-disc physics: gravity + wall bounce + pairwise elastic collisions.
// Discs settle and pack at the bottom of the canvas.
let discs = [], S;
function setup() {
randomSeed(SEED);
S = Math.min(windowWidth, windowHeight);
createCanvas(S, S);
colorMode(HSB, 360, 100, 100);
const baseHue = random(360);
const n = 60;
for (let i = 0; i < n; i++) {
const r = random(S*0.02, S*0.05);
discs.push({ x: random(r, S-r), y: random(r, S*0.4), vx: random(-2,2), vy: 0, r, m: r*r,
hue: (baseHue + random(-40, 40) + 360) % 360 });
}
noStroke();
}
function draw() {
background(40, 8, 92);
const g = S * 0.0009;
for (const d of discs) { d.vy += g; d.x += d.vx; d.y += d.vy; }
// walls
for (const d of discs) {
if (d.x < d.r) { d.x = d.r; d.vx *= -0.7; }
if (d.x > S-d.r) { d.x = S-d.r; d.vx *= -0.7; }
if (d.y > S-d.r) { d.y = S-d.r; d.vy *= -0.45; d.vx *= 0.92; }
}
// pairwise collisions (elastic, equal-ish)
for (let i = 0; i < discs.length; i++)
for (let j = i+1; j < discs.length; j++) {
const a = discs[i], b = discs[j];
let dx = b.x-a.x, dy = b.y-a.y;
let dist = Math.hypot(dx, dy) || 1e-4;
const overlap = a.r + b.r - dist;
if (overlap > 0) {
const nx = dx/dist, ny = dy/dist;
const push = overlap/2;
a.x -= nx*push; a.y -= ny*push; b.x += nx*push; b.y += ny*push;
const rvx = b.vx-a.vx, rvy = b.vy-a.vy;
const vn = rvx*nx + rvy*ny;
if (vn < 0) {
const imp = -1.6*vn/(1/a.m + 1/b.m);
a.vx -= imp/a.m*nx; a.vy -= imp/a.m*ny;
b.vx += imp/b.m*nx; b.vy += imp/b.m*ny;
}
}
}
for (const d of discs) { fill(d.hue, 60, 90); circle(d.x, d.y, d.r*2); }
}仕組み
毎フレーム微小時間だけ世界を進める:(1) 力の適用=重力・抵抗・バネ・アトラクタ・入力/場 を各物体で合算し加速度に(a=F/m)、(2) 積分=速度と位置を更新(セミインプリシット Euler、安定性と制約の扱いやすさで Verlet)、(3) 衝突/制約の検出と解決=重なりを探し(多くは広域フェーズの空間グリッド)、物体を押し離し速度を補正(力積または位置ベース補正)、硬い積み重ねには反復。サブステップと制約反復で速度と安定性を調整。アート作品では創発的な動力学(堆積・垂れ・群れ・飛沫)に構図を作らせ、時に一瞬を凍結して最終静止画にする。
パラメータ
gravity: number — Constant acceleration applied to the bodies.restitution: number — Bounciness; the velocity retained after a collision.friction: number — Tangential resistance at contacts.timestep: number — Integration step of the solver.
系譜
よく組み合わされるアルゴリズム
- Fragment Shader (GLSL) · 3 作品
- Particle System · 2 作品
- Audio-Reactive · 2 作品
- Perlin / Simplex Noise · 2 作品
- Marching Squares / Contours · 1 作品
- HSL / Hue Cycle · 1 作品
- Bezier / Catmull-Rom Splines · 1 作品
- Flow Field / Vector Field · 1 作品
- Instanced Geometry · 1 作品
- Raymarching with SDFs · 1 作品
- Glitch / Datamosh · 1 作品
- Polygon Mosaic · 1 作品
このアルゴリズムを使う作品 (12)
Cerebellum
laya-mathikshara-santiago
Chain
leander-herzog
Diggly Collects All
dca
Dipolar
junia-farquhar
Floccus
golan-levin
FluidScapes
reza-ali
Melancholic Magical Maiden
emi-kusano
Open House
mark-j-stock
Scatter Process[or]
kelly-milligan
SKEUOMORPHS
itsgalo
Tide Predictor
lovid
Universe of Water Particles
teamlab
最終更新 2026-07-16