xxxxxxxxxx
function setup() {
createCanvas(windowWidth, windowHeight);
background(0);
rectMode(CENTER);
}
function draw() {
//background(0);
// jump to the center of the sketch
translate(width/2, height/2);
// mapping of sin over time (-1 ... +1) to -200 ... 200
// speed is defined by /1000
let s = map(sin(millis()/300), -1, 1, -100, 100);
noFill();
stroke(255);
translate(s, 0);
//ellipse(0, 0, 200, 200);
//ellipse(0, 0, 50, 50);
ellipse(0, 0, s, s);
translate(s, -s, 0);
ellipse(0, 0, s, s);
translate(s, -s, 0);
ellipse(0, 0, -s,-s);
translate(-s, 0); //umgedreht
ellipse(0, 0, -s, -s);
translate(-s, s, 0);
ellipse(0, 0, -s, -s);
translate(-s, s, 0)
ellipse(0, 0, s, s);
/*
Anwendungsbereiche:
Position (x, y)
Rotation (Winkel)
Grösse / Skalierung (Breite / Höhe)
Rundungen rect
Farbe, Deckkraft
Outline / strokeWeight
-> Geschwindigkeit
*/
}