xxxxxxxxxx
var template;
var minLen = 8;
var numRect = 40;
var strokeOverLen = 0.02;
var tiltAngle = 5;
var speed = 0.1;
var a = 30;
var b = 96;
var w = 1920/5*4;
var h = 1080/5*4;
function preload(){
template = loadImage("projectortemplate_rsvp.png");
}
function setup() {
createCanvas(w, h);
background(255);
rectMode(CENTER);
angleMode(DEGREES);
imageMode(CENTER);
template.resize(w, h);
}
function draw() {
background(255);
//fill(255);
//fill(random(255), random(255), random(255), 50);
//stroke(random(255), random(255), random(255));
//stroke(100, 100, 255, 100);
for (i=0; i<=numRect; i++){
push();
translate(width/2, height/2);
if (i%2 == 0){
rotate(-tiltAngle*(i+1));
}
else{
rotate(tiltAngle*(i+1));
}
strokeWeight(minLen*(numRect-i)*strokeOverLen);
//stroke(33, 3, 55, a*(i+1));
stroke(random(40, 80), 5, random(50,200), a*(i+1));
rect(0, 0, minLen*(numRect-i), minLen*(numRect-i));
pop();
}
/*
if (0<a<255){
a+=1;
}
else{
a-=5;
}
*/
tiltAngle += speed;
image(template, width/2, height/2);
}