xxxxxxxxxx
function setup() {
createCanvas(559, 397, SVG);
//background(255);
rectMode(CENTER);
clear();
}
function draw() {
//noLoop();
//background(255, 5);
translate(width/2,height/2);
let s= map(sin(millis()/1000), -2.5, 5, -500, 500);
let r = map(sin(millis()/1500), -1, 1, 0, PI);
noFill();
stroke(0);
translate(s, 0);
rotate(r);
//scale(0.5, 1.5);
//circle(0, 0, 200);
rect(0, 0, 80, 100, 200, 200, 10, 10);
let s2= map(sin(millis()/1000), -5, 5, -500, 500);
let r2 = map(sin(millis()/1500), -1, 1, 0, PI);
noFill();
stroke(0);
translate(s2, 5);
rotate(r2);
rect(0, 0, 130, 150, 250, 200, 10, 10);
}
function mousePressed() {
save("mySVG.svg");
}