//Alana Perlin //December 2003 //Refinement 157A //The refined image conveys a disharmonious //relationship between the original and //overlayed elements in the double exposure. //Working with the theme of natural versus //artificial photographic components, actions //and animations occur which alter the sketch. //The extended exploration reveals new territories //within the picture and creates a dynamic //and personalized series of animations. //Small hints are given to reveal new actions, //such as the cursor changing to a "move" style //to indicate dragging the mouse for the plant //and sand to move. Pressing "z" activates the //zoom mode. //the first windmill //the windmill's variables float angles; float v; float g; int m; float b; float d; float q; //Perlin noise float noiseVal; float noiseScale=0.02; float l = 2; //for the pinwheel's strokeWeight float wheel = 2.2; //for the distortion float curvature=1; int gridSize=10; float radius=0,maxRadius=100; //the desert sand animation images int numFrames = 18; // The number of frames in the sand animation int frame = 0; BImage[] images = new BImage[numFrames]; //the desert plant animation images int numPlant = 12; // The number of frames in the plant animation int branch = 0; BImage[] grow = new BImage[numPlant]; //the desert spider animation images int numTarantula = 26; // The number of frames in the spider animation int crawl = 0; BImage[] spider = new BImage[numTarantula]; //the desert sky animation images int numSky = 5; // The number of frames in the sky animation int sunset = 0; BImage[] dusk = new BImage[numSky]; // number of Images int imageNum = 1; ImageFader[] fade = new ImageFader[imageNum]; //this boolean initializes the fading effect boolean locked = false; //the background image BImage desert2; //the archway image BImage archway; //the desert background xfigure BImage desert_back; void setup(){ size(400,400); cursor(CROSS); framerate(4); //colorMode(HSB, 360, 100, 100, 100); noStroke(); //the animation sequence //loading the sand images images[0] = loadImage("desert_sandstorm1.jpg"); images[1] = loadImage("desert_sandstorm2.jpg"); images[2] = loadImage("desert_sandstorm3.jpg"); images[3] = loadImage("desert_sandstorm4.jpg"); images[4] = loadImage("desert_sandstorm5.jpg"); images[5] = loadImage("desert_sandstorm6.jpg"); images[6] = loadImage("desert_sandstorm7.jpg"); images[7] = loadImage("desert_sandstorm8.jpg"); images[8] = loadImage("desert_sandstorm9.jpg"); images[9] = loadImage("desert_sandstorm9.jpg"); images[10] = loadImage("desert_sandstorm8.jpg"); images[11] = loadImage("desert_sandstorm7.jpg"); images[12] = loadImage("desert_sandstorm6.jpg"); images[13] = loadImage("desert_sandstorm5.jpg"); images[14] = loadImage("desert_sandstorm4.jpg"); images[15] = loadImage("desert_sandstorm3.jpg"); images[16] = loadImage("desert_sandstorm2.jpg"); images[17] = loadImage("desert_sandstorm1.jpg"); //the animation sequence //loading the plant images grow[0] = loadImage("desert_plantgrowth.jpg"); grow[1] = loadImage("desert_plantgrowth1.jpg"); grow[2] = loadImage("desert_plantgrowth2.jpg"); grow[3] = loadImage("desert_plantgrowth3.jpg"); grow[4] = loadImage("desert_plantgrowth4.jpg"); grow[5] = loadImage("desert_plantgrowth5.jpg"); grow[6] = loadImage("desert_plantgrowth5.jpg"); grow[7] = loadImage("desert_plantgrowth4.jpg"); grow[8] = loadImage("desert_plantgrowth3.jpg"); grow[9] = loadImage("desert_plantgrowth2.jpg"); grow[10] = loadImage("desert_plantgrowth2.jpg"); grow[11] = loadImage("desert_plantgrowth.jpg"); //the animation sequence //loading the tarantula images spider[0] = loadImage("tarantula1_newest.gif"); spider[1] = loadImage("tarantula2_newest.gif"); spider[2] = loadImage("tarantula3_newest.gif"); spider[3] = loadImage("tarantula4_newest.gif"); spider[4] = loadImage("tarantula5_newest.gif"); spider[5] = loadImage("tarantula6_newest.gif"); spider[6] = loadImage("tarantula7_newest.gif"); spider[7] = loadImage("tarantula8_newest.gif"); spider[8] = loadImage("tarantula9_newest.gif"); spider[9] = loadImage("tarantula10_newest.gif"); spider[10] = loadImage("tarantula11_newest.gif"); spider[11] = loadImage("tarantula12_newest.gif"); spider[12] = loadImage("tarantula13_newest.gif"); spider[13] = loadImage("tarantula14_newest.gif"); spider[14] = loadImage("tarantula15_newest.gif"); spider[15] = loadImage("tarantula16_newest.gif"); spider[16] = loadImage("tarantula17_newest.gif"); spider[17] = loadImage("tarantula18_newest.gif"); spider[18] = loadImage("tarantula19_newest.gif"); spider[19] = loadImage("tarantula20_newest.gif"); spider[20] = loadImage("tarantula21_newest.gif"); spider[21] = loadImage("tarantula22_newest.gif"); spider[22] = loadImage("tarantula23_newest.gif"); spider[23] = loadImage("tarantula24_newest.gif"); spider[24] = loadImage("tarantula25_newest.gif"); spider[25] = loadImage("tarantula26_newest.gif"); /* spider[26] = loadImage("tarantula26_newest.gif"); spider[27] = loadImage("tarantula25_newest.gif"); spider[28] = loadImage("tarantula24_newest.gif"); spider[29] = loadImage("tarantula23_newest.gif"); spider[30] = loadImage("tarantula22_newest.gif"); spider[31] = loadImage("tarantula21_newest.gif"); spider[32] = loadImage("tarantula20_newest.gif"); spider[33] = loadImage("tarantula19_newest.gif"); spider[34] = loadImage("tarantula18_newest.gif"); spider[35] = loadImage("tarantula17_newest.gif"); spider[36] = loadImage("tarantula16_newest.gif"); spider[37] = loadImage("tarantula15_newest.gif"); spider[38] = loadImage("tarantula14_newest.gif"); spider[39] = loadImage("tarantula13_newest.gif"); spider[40] = loadImage("tarantula12_newest.gif"); spider[41] = loadImage("tarantula11_newest.gif"); spider[42] = loadImage("tarantula10_newest.gif"); spider[43] = loadImage("tarantula9_newest.gif"); spider[44] = loadImage("tarantula8_newest.gif"); spider[45] = loadImage("tarantula7_newest.gif"); spider[46] = loadImage("tarantula6_newest.gif"); spider[47] = loadImage("tarantula5_newest.gif"); spider[48] = loadImage("tarantula4_newest.gif"); spider[49] = loadImage("tarantula3_newest.gif"); spider[50] = loadImage("tarantula2_newest.gif"); spider[51] = loadImage("tarantula1_newest.gif"); */ //the animation sequence //loading the sky images dusk[0] = loadImage("desert_sky.jpg"); dusk[1] = loadImage("desert_sky1.jpg"); dusk[2] = loadImage("desert_sky2.jpg"); dusk[3] = loadImage("desert_sky3.jpg"); dusk[4] = loadImage("desert_sky4.jpg"); //loading the archway image archway = loadImage("archway.gif"); //loading the background image desert_back = loadImage("desert_back.jpg"); // the ImageFader Object // // ImageFader( the name, width, height, the x location, the y location, fade speed) //the ImageFader objects fade[0]= new ImageFader("silhouette.gif",161,300,172,100,0.025); } //the floats are variables for the desert image's translation float zdepth=0.0; float Xpos=0; void loop(){ background(desert_back); if (keyPressed==true){ //the desert image translation zoom if ( key == 'z'){ Xpos = (400+mouseX); zdepth = (mouseY/2); zdepth = constrain (zdepth, 0, 70); push(); translate(Xpos/20, 0, zdepth); image(desert_back, -30, 0, 415, 415); pop(); //the tarantula's debut on the sketch crawl = (crawl+1)%numTarantula; // Use % to cycle through frames image(spider[crawl], 0, 0); println("tarantula"); } } //the distortion code noStroke(); if (mousePressed) { radius+=(maxRadius-radius)*0.1; } else { radius*=0.98; } //unit sphere equation x*x+y*y+z*z=r //then evaluate each grid point's distance from the lens center and adjust the z coord. if (curvature<0) translate(250,50,-700); for(int y=0; y<=height; y+=gridSize) { float sqy=sq(mouseY-y), sqy1=sq(mouseY-(y+gridSize)); //polygon creates a pixelated distortion beginShape(POLYGON); texture(archway); for(int x=0; x<=width; x+=gridSize) { //lens behavior modified by altering the curvature variable, neg values=depressed result vertex(x,y,min(max(radius-sqrt(sq(mouseX-x)+sqy)*curvature,0),120),x,y); vertex(x,y+gridSize,min(max(radius-sqrt(sq(mouseX-x)+sqy1)*curvature,0),120),x,y+gridSize); } endShape(); } //setting the windmill if (mouseX > 70 && mouseX < 150 && mouseY>150 && mouseY <230) { stroke(150); strokeWeight(2); smooth(); //control the windmill's center, diameter, number of rings for (m=1;m<=40;m=m+1){ //control the rotation and ring cycle for (angles=b;angles xmin && mouseY < ymax && mouseY> ymin ){ //a custom cursor--to signify that you must click and move the cursor try { setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR)); } catch(Exception e) { println(e); } if (mousePressed){ fadeMe= true; } } // if it was clicked, fade it. if (fadeMe==true){ imageAlpha +=(0-imageAlpha)*speed; } tint(255, 255, 255, imageAlpha); image(myImage, xmin, ymin); } } void mouseDragged(){ //setting the animated sand image sequence if (mouseX > 55 && mouseX < 160 && mouseY>300 && mouseY <400) { //a custom cursor--to signify that you must click and move the cursor try { setCursor(new Cursor(Cursor.MOVE_CURSOR)); } catch(Exception e) { println(e); } frame = (frame+1)%numFrames; // Use % to cycle through frames image(images[frame], 0, 0); println("sand"); } //setting the animated plant image sequence else if (mouseX > 0 && mouseX < 55 && mouseY>0 && mouseY <400) { //a custom cursor--to signify that you must click and move the cursor try { setCursor(new Cursor(Cursor.MOVE_CURSOR)); } catch(Exception e) { println(e); } branch = (branch+1)%numPlant; // Use % to cycle through frames image(grow[branch], 0, 0); println("plant"); } //dragging on the windmill results in a pinwheel windmill that increases //the speed of the clouds on the silhouette through dragging else if (mouseX > 70 && mouseX < 150 && mouseY>150 && mouseY <230) { try { setCursor(new Cursor(Cursor.CROSSHAIR_CURSOR)); } catch(Exception e) { println(e); } stroke(220); strokeWeight(wheel); smooth(); //control the windmill's center, diameter, number of rings for (m=1;m<=50;m=m+1){ //control the rotation and ring cycle for (angles=b;angles 70 && mouseX < 150 && mouseY>260 && mouseY <400) { //a custom cursor--to signify that you must click and move the cursor try { setCursor(new Cursor(Cursor.MOVE_CURSOR)); } catch(Exception e) { println(e); } sunset = (sunset+1)%numSky; // Use % to cycle through frames image(dusk[sunset], 0, 0); println("sky"); } }