//most of the time, fashion just recycles elements from the past
//so, with a selection of fashion plates
//spanning a couple of centuries,
//making an "original" fashion is as easy as a wave of a mouse!
//clothing is organized by time from Rennaissance(1500's and 1600's
// to Empire Era (early 1800's)
PImage[] top = new PImage[8];
PImage[] middle= new PImage[8];
PImage[] bottom=new PImage[8];
int frame=0;
int frame2=0;
int frame3=0;
void setup() {
size(400,400);
///////arrays for storing images
for (int i=0; i<8; i++) {
String imageName = "head"+i+".png";
top[i]=loadImage(imageName);
String imageName2 = "torso"+i+".png";
middle[i]=loadImage(imageName2);
String imageName3 = "legs"+i+".png";
bottom[i]=loadImage(imageName3);
}
}
void draw() {
// background(248,229,202);
background(frame*6.7+200,frame2*6.7+200,frame3*6.7+200);
stroke(255);
strokeWeight(2);
randomSeed(25);
for (int i=0; i<400; i+=random(5,15)) {
line(i,0,i,400);
}
if ((mouseY>0)&&(mouseY<75)) { //changes top image
frame=ceil(mouseX/50);
}
if ((mouseY>75)&&(mouseY<180)) { //changes middle image
frame2=ceil(mouseX/50);
}
if ((mouseY>180)&&(mouseY<400)) { //changes bottom image
frame3=ceil(mouseX/50);
}
image(top[frame],0,0);
image(middle[frame2],0,0);
image(bottom[frame3],0,180);
}
Exercise 11: Load a sequence of images into an array and use the mouse position to control the sequence and time of their display.