xxxxxxxxxx
60
// Sketch By KaisiangSin
function setup() {
createCanvas(600, 850);
}
function draw() {
background(0);
translate(50,0)
scale(0.8)
noStroke();
textSize(15);
fill(192,192,192);
M() ;
}
function M() {
const dim = Math.min(width, height);
// Get time in seconds
const time = millis() / 6000;
// Loop duration
const duration = 1;
const playhead = (time / duration) % 9;
const start = [width * 0.2, height];
const end = [width * 0.5, height / 2];
let t0 = sin(playhead * HALF_PI);
t0 = t0 * 0.5 + 0.5;
const x = lerp(start[0], end[0], t0);
const y = lerp(start[1], end[1], t0);
beginShape();
translate(10,50)
// fill(255,255,255);
noStroke();
vertex(50, 50);
vertex(x,50);
vertex(300, 400);
vertex(300, 50);
vertex(450, 50);
vertex(540, 500);
vertex(450, y);
vertex(350, 100);
vertex(400, y);
vertex(x, 450);
//K
vertex(100, 100);
vertex(x, 500);
vertex(50, x);
//ellipse(x,200,20,20)
endShape(CLOSE);
}