xxxxxxxxxx
124
let rectWidth =1;
let rectHeight = 200;
let yLoc0, yLoc1, yLoc2, yLoc3, yLoc4, yLoc5, yLoc6, yLoc7, yLoc8 ;
let speed = 0.01
function setup() {
createCanvas(640, 640);
// frameRate(10);
yLoc0= height * .10
yLoc1= height * .20
yLoc2= height * .30
yLoc3= height * .40
yLoc4= height * .50
yLoc5= height * .60
yLoc6= height * .70
yLoc7= height * .80
yLoc8= height * .90
// rectMode(CENTER);
}
function draw() {
noStroke();
background(0);
// fill(random(0,255),200,200,100);
fill(255,random (0,100),random(0,100),random (0,100),100);
for (let i = rectHeight / 2; i < height; i += rectWidth) {
let noiseValue= noise(frameCount * speed,i *.001);
let angle= ( noiseValue) * 9*PI;
push();
translate (i,yLoc0);
rotate(angle)
rect(0, 0, rectWidth, rectHeight);
pop();
}
// fill(255,random(0,100),255,random(0,100),100);
for (let i = rectHeight / 2; i < height; i += rectWidth) {
let noiseValue= noise(frameCount * speed,i *.01);
let angle= ( noiseValue) * 8*PI;
push();
translate (i,yLoc1);
rotate(angle)
rect(0, 0, rectWidth, rectHeight);
pop();
}
// fill(random (0,100),random(0,100),255,random(0,100),100);
for (let i = rectHeight / 2; i < height; i += rectWidth) {
let noiseValue= noise(frameCount * speed,i *.001);
let angle= ( noiseValue) * 7*PI;
push();
translate (i,yLoc2);
rotate(angle)
rect(0, 0, rectWidth, rectHeight);
pop();
}
// fill(random(0),255,random(0,255),random (0,255),100);
for (let i = rectHeight / 2; i < height; i += rectWidth) {
let noiseValue= noise(frameCount * speed,i *.01);
let angle= ( noiseValue) * 6*PI;
push();
translate (i,yLoc3);
rotate(angle)
rect(0, 0, rectWidth, rectHeight);
pop();
}
// fill(255,255,random(0,255),random (0,255),100);
for (let i = rectHeight / 2; i < height; i += rectWidth) {
let noiseValue= noise(frameCount * speed,i *.001);
let angle= ( noiseValue) * 5*PI;
push();
translate (i,yLoc4);
rotate(angle)
rect(0, 0, rectWidth, rectHeight);
pop();
}
// fill(255,random (0,255),random(0,255),random (0,255),100);
for (let i = rectHeight / 2; i < height; i += rectWidth) {
let noiseValue= noise(frameCount * speed,i *.01);
let angle= ( noiseValue) * 6*PI;
push();
translate (i,yLoc5);
rotate(angle)
rect(0, 0, rectWidth, rectHeight);
pop();
}
// fill(255,random(0,255),255,random(0,255),100);
for (let i = rectHeight / 2; i < height; i += rectWidth) {
let noiseValue= noise(frameCount * speed,i *.001);
let angle= ( noiseValue) * 7*PI;
push();
translate (i,yLoc6);
rotate(angle)
rect(0, 0, rectWidth, rectHeight);
pop();
}
// fill(random (0,100),random(0,100),255,random(0,100),100);
for (let i = rectHeight / 2; i < height; i += rectWidth) {
let noiseValue= noise(frameCount * speed,i *.01);
let angle= ( noiseValue) * 8*PI;
push();
translate (i,yLoc7);
rotate(angle)
rect(0, 0, rectWidth, rectHeight);
pop();
}
// fill(random(0),255,random(0,255),random (0,255),100);
for (let i = rectHeight / 2; i < height; i += rectWidth) {
let noiseValue= noise(frameCount * speed,i *.001);
let angle= ( noiseValue) * 9*PI;
push();
translate (i,yLoc8);
rotate(angle)
rect(0, 0, rectWidth, rectHeight);
pop();
}
}