nick34992
4/19/2016 - 3:13 PM

Quad. Using p5.js library.

Quad. Using p5.js library.

function setup() {
   createCanvas(720, 400);
 }

 function draw() {
   background(0, random(170, 255), random(170, 255));
   noStroke(0);
   for (var i = 0; i < 20; i++) {
     // quad a
     var x1 = random(0, 360);
     var y1 = random(0, 200);
     var x2 = random(360, 720);
     var y2 = random(200, 400);
     var x3 = random(0, 360);
     var y3 = random(0, 200);
     var x4 = random(360, 720);
     var y4 = random(0, 200);
     // quad b
     var x5 = random(0, 360);
     var y5 = random(200, 400);
     var x6 = random(360, 720);
     var y6 = random(0, 200);
     var x7 = random(0, 360);
     var y7 = random(200, 400);
     var x8 = random(360, 720);
     var y8 = random(0, 200);
     fill(random(0, 85), random(85, 170), random(85, 170), random(20, 80));
     quad(x1, y1, x2, y2, x3, y3, x4, y4);
     quad(x5, y5, x6, y6, x7, y7, x8, y8);
   }
   frameRate(1);
 }