90s Movie
課題名 : Programming graphics
概要 : ランダムや繰り返しを用いた、プログラミングによるグラフィックスの生成
PShader blur;
PImage gazou;
PImage gazou;
void setup() {
size(800, 533, P2D);
blur = loadShader("blur.glsl");
gazou = loadImage("IMG_0930_2.jpg");
}
size(800, 533, P2D);
blur = loadShader("blur.glsl");
gazou = loadImage("IMG_0930_2.jpg");
}
void draw() {
filter(blur);
image(gazou,0,0);
stroke(255);
strokeWeight(random(1.10));
float y = random(height);
line(0,y,width,y);
line(0,y,width,y);
ellipse(random(width),random(height),random(1.2),random(1.2));
ellipse(random(width),random(height),random(1.4),random(1.4));
ellipse(random(width),random(height),random(1.6),random(1.6));
ellipse(random(width),random(height),random(1.8),random(1.8));
ellipse(random(width),random(height),random(2.6),random(2.6));
ellipse(random(width),random(height),random(2.8),random(2.8));
rect(random(width),random(height),random(2.2),random(2.2));
rect(random(width),random(height),random(3.2),random(3.2));
rect(random(width),random(height),random(4.2),random(4.2));
rect(random(width),random(height),random(5.2),random(5.2));
int barWidth = 28;
int lastBar = -11;
filter(blur);
image(gazou,0,0);
stroke(255);
strokeWeight(random(1.10));
float y = random(height);
line(0,y,width,y);
line(0,y,width,y);
ellipse(random(width),random(height),random(1.2),random(1.2));
ellipse(random(width),random(height),random(1.4),random(1.4));
ellipse(random(width),random(height),random(1.6),random(1.6));
ellipse(random(width),random(height),random(1.8),random(1.8));
ellipse(random(width),random(height),random(2.6),random(2.6));
ellipse(random(width),random(height),random(2.8),random(2.8));
rect(random(width),random(height),random(2.2),random(2.2));
rect(random(width),random(height),random(3.2),random(3.2));
rect(random(width),random(height),random(4.2),random(4.2));
rect(random(width),random(height),random(5.2),random(5.2));
int barWidth = 28;
int lastBar = -11;
int whichBar = mouseX / barWidth;
if (whichBar != lastBar) {
int barX = whichBar * barWidth;
fill(mouseY, height, height);
rect(barX, 0, barWidth, height);
lastBar = whichBar;
}
fill(0, 255, 0);
rect(random(width),0,random(100),800);
fill(255, 20, 147);
rect(random(width),0,random(100),800);
fill(0, 255, 255);
rect(random(width),0,random(100),800);
fill(255, 255, 255);
rect(random(width),0,random(100),800);
if (whichBar != lastBar) {
int barX = whichBar * barWidth;
fill(mouseY, height, height);
rect(barX, 0, barWidth, height);
lastBar = whichBar;
}
fill(0, 255, 0);
rect(random(width),0,random(100),800);
fill(255, 20, 147);
rect(random(width),0,random(100),800);
fill(0, 255, 255);
rect(random(width),0,random(100),800);
fill(255, 255, 255);
rect(random(width),0,random(100),800);
if(keyPressed == true){
if(key == 'S'){
saveFrame("####.png");
}
}
if(key == 'S'){
saveFrame("####.png");
}
}
}