粒子生命
Particle Life,Hunar Ahmad,2022 年

正在布展…
它是怎么做的
- 第 1 步每种颜色对另一种颜色有一个 -1 到 1 的作用系数
- 第 2 步每帧对所有粒子对计算距离,在作用半径内按 系数/距离 施加力
- 第 3 步速度乘以阻尼后更新位置,边界反弹
- 第 4 步随机化系数表就会得到新的“生态系统”
复刻配方
一段技术配方,可以直接交给 AI 编程助手,也可以自己照着写。想指定技术栈、位置和性能预算,就把它加入实现方案。
Create a few groups of particles, each with a colour, and a square matrix of interaction coefficients between groups in [-1, 1]. Each frame, for every particle sum forces from particles of each group within a radius, using coefficient times 1/distance (or a piecewise curve that is repulsive at very short range). Add the force to velocity, multiply by a friction factor, update position and bounce or wrap at edges. Expose the matrix as sliders with a randomise button, and use a spatial grid to scale beyond a few thousand particles.
档案
性能开销
视觉强度
实现难度
尺度为策展判断(1 到 5),用于比较和推荐。
核实记录:Opened https://hunar4321.github.io/particle-life/particle_life.html (200, title 'Life'); repo hunar4321/particle-life exists, licence MIT via GitHub API (Copyright 2022 Hunar Ahmad).


