xxxxxxxxxx
28
let y = 0;
let x = 0;
function setup() {
createCanvas(400, 400);
frameRate(10);
background(66);
}
function draw() {
stroke(255);
fill(255);
// with point
// point(x, 200 + sin(y) * 150);
//
// vertex cheat. it is only doing dots... not lines
beginShape();
for (let i = 0; i < 400; i++) {
vertex(x + 200, 200 + sin(y) * 150);
}
endShape();
y += 0.01;
x += 0.05;
}