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()/1500), -1, 1, -200, 200);
let sc = map(cos(millis()/1500), -1, 1, -100, 100);
// mappingf sin over time to an angle 0-PI
let r = map(sin(millis()/5500), -1, 1, 0, PI);
let c = map(sin(millis()/1000), -1, 1, 0, 50);
let w = map(sin(millis()/1000), -1, 1, 100, 250);
noFill();
stroke(255); //, c);
translate(s, sc);
//rotate(r);
//strokeWeight(c);
//rect(0, 0, w, w);
//ellipse(0, 0, 200, 200);
//rect(0, 0, r, r);
//rect(0, 0, c, c);
//rect(0, 0, w, w);
//circle(0, 0, w, w);
//line(10, 10, s, s);
//line(10, 10, -s, -s);
//line(10, 10, -s, s);
//line(10, 10, s, -s);
line(-10, -10, s, s);
line(-10, -10, -s, -s);
line(-10, -10, -s, s);
line(-10, -10, s, -s);
//line(-10, -10, 0, sc);
/*
Anwendungsbereiche:
Position (x, y)
Rotation (Winkel)
Grösse / Skalierung (Breite / Höhe)
Rundungen rect
Farbe, Deckkraft
Outline / strokeWeight
-> Geschwindigkeit
*/
}