xxxxxxxxxx
const nodeNum = 500;
const nodes = [];
function setup() {
createCanvas(600, 600);
colorMode(HSB, 360, 100, 100);
blendMode(ADD);
background(0);
for (let i = 0; i < nodeNum; i++) {
let x = random(width);
let y = random(height);
nodes.push(createVector(x, y));
}
for (let h = 0; h < nodeNum - 2; h++) {
let n = nodes[h];
for (let i = h + 1; i < nodeNum - 1; i++) {
let m = nodes[i];
for (let j = i + 1; j < nodeNum; j++) {
let l = nodes[j];
if (
dist(n.x, n.y, m.x, m.y) < 150 &&
//dist(n.x, n.y, l.x, l.y) < 150 &&
dist(m.x, m.y, l.x, l.y) < 8
) {
fill(random(200, 290), 80, 100);
noStroke();
triangle(n.x, n.y, m.x, m.y, l.x, l.y);
}
}
}
}
}