xxxxxxxxxx
44
//------------------------------//
var waveLengthOne = 125.0;
var waveLengthTwo = 90.0;
//------------------------------//
var pointCount = 0;
var angle = 0.0;
var amplitude = 200;
let colors = ["#01FFF4", "#FF1178", "#7CFF01"];
function setup() {
createCanvas(500, 500);
stroke(colors[0]);
}
function draw() {
if(pointCount > 10000){
noLoop();
}
background(20);
noFill();
strokeWeight(3);
//if(frameCount % 60 == 0)
if(frameCount % 60 > 30)
stroke(colors[floor(random(0, colors.length))]);
translate(width/2, height/2);
beginShape();
for(var i = 0; i < pointCount; i++){
angle = i / waveLengthOne * TWO_PI;
var y = sin(angle) * amplitude;
angle = i / waveLengthTwo * TWO_PI;
var x = sin(angle) * amplitude;
vertex(x, y);
}
endShape();
pointCount++;
}