/*Jeremy Turner (JOT) Assignment A2-06 #200024742 Write a function with three or more parameters and visually demonstrate its flexibility.*/ //"Illusion of an Optical Illusion" - About this piece... //I intentionally did the constrasting colour flickers... //and the slow framerate in order to give the optical illusion... //..that the movement and growing of the rectangles... //...was only an optical illusion and nothing more... //...in fact, there are no tricks of the eye... //...the rectangles are actually moving around, if you look long enough... int z=0; void createRect(int x,int y,int h, int v){ rect(x,y,h,v); //Pooya likes putting the custom functions at the top above setup... //I am seeing if this method works for me...by seeing if it gives me more topview //..for the code... } void setup(){ background(20); //I noticed that Pooya during his example session, //..moved the background to void draw so it would not... //...be over-drawn but I am more comfortable, //..declaring those types of features in void setup size (600,600); frameRate(4); } void draw(){ background(random (255), random (255), random (255)); z=z+1; createRect(z,99,72,z); createRect (66, 244, 77, z); createRect (z, 277, z, 111); createRect (333, z/2, 555, 444); //I realize that I have to repeat the custom function name also in void draw... //..this was my main "ah-ha!" moment (one of many) with Pooya. //I decided to place the modified moving Z variable in more than one vertex point... //...to demonstrate its flexibility //I started with an ellipse to deal with less vertex points... //I reduced the shape further to simply a rectangle. fill (random (255), random (255), random (255)); }