xxxxxxxxxx
49
let a = 0;
let r = 2;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
background(255);
rectMode(CENTER);
}
function draw() {
//led(width/3, height/4, 50, 50);
//led(50, 50, 20, 20);
//a = a + 1;
sithLordTriangle(mouseX, mouseY, 100, 100);
sithLordTriangle(100, 100, 100, 100);
}
function led(x, y, w, h) {
push();
translate(x, y);
rotate(a);
//fill(170, 220, 255, random(100));
fill(20, 160, 255, random(50));
//stroke(10, 170, 250, random(100));
strokeWeight(1);
//stroke(10, 150, 255);
noStroke();
ellipse(x, y, w, h);
a = a + 1;
pop();
}
function sithLordTriangle(x, y, w, h){
push();
translate(mouseX, mouseY);
rotate(r);
r = r + random(100);
fill(random(255), 20, 20, random(80));
noStroke();
beginShape();
vertex(50, random(10, 300));
vertex(30, 300);
vertex(100,100);
endShape();
pop();
}