xxxxxxxxxx
28
let nSchritte = 10;
function setup() {
createCanvas(400, 400);
background(255);
noFill();
}
function draw() {
background(255);
const schrittweite = width / nSchritte;
for (let y = schrittweite / 2; y < width; y = y + schrittweite) {
for (let x = schrittweite / 2; x < width; x = x + schrittweite) {
const durchmesser = osz(0.1, 0, 100);
circle(x, y, durchmesser);
}
}
}
function osz(frequenz, von, bis, phase=0) {
let wert = sin((millis()/1000.0 + phase) * TWO_PI * frequenz);
wert = map(wert, -1, 1, von, bis);
return wert;
}
// https://www.maschinennah.de/p5js-halle