Recitation 007

PART I:

Code:

void setup(){
  size(800,800);
}

void draw(){
  background(0);
  for (int x=0;x<width;x+=55){
    for(int y=0;y<height;y+=55){
      color e=color(random(0,255));
       color m=color(random(0,255),random(0,255),random(0,255));
    face(x,y,e,m);
  }
  }
} 

void face(float x, float y, color eyes, color mouth){
  fill(#F5EF31);
  circle(x,y,50);
  //stroke(#F5EF31);
  //line(x,y-60,x,y+60);
  //line(x-50,y-50,x+50,y+50);
  fill(eyes);
  circle(x-10,y-10,10);
  circle(x+10,y-10,10);
  
  fill(mouth);
   arc(x, y+10, 16, 16, 0, PI);
   //ellipse(x,y+10,30,10);
}

 PART II:

Code:

float[] x= new float[20];
float[] y= new float[20];
float[] size= new float[20];
int[] colore= new int[20];
int[] colorm= new int[20];
int e;
int m;


void setup(){
  size(800,800);
  //for(int i=0; i< x.length;i++){
  //  x[i]+=55;
  //  y[i]+=55;
  //  size[i]=random(40,60);
}
//}

void draw(){
  background(0);
 for(int i=0; i<2;i++){
   e=colore[i]= color(random(0,255));
   m=colorm[i]= color(random(0,255),random(0,255),random(0,255));
   
  for (int x=25;x<width;x+=75){
    for(int y=25;y<height;y+=75){
  //    //color e=color(random(0,255));
  //    // color m=color(random(0,255),random(0,255),random(0,255));
   
    face(x,y,size[i],e,m);
    x+=random(-0.1,0.1);
    y+=random(-0.1,0.1);
 }
  }
 }
} 

void face(float x, float y, float size, color eyes, color mouth){
  fill(#F5EF31);
  noStroke();
  circle(x,y,50);
  //stroke(#F5EF31);
  //line(x,y-60,x,y+60);
  //line(x-50,y-50,x+50,y+50);
  fill(eyes);
  circle(x-10,y-10,10);
  circle(x+10,y-10,10);
  
  fill(mouth);
  arc(x, y+10, 16, 16, 0, PI);
   //ellipse(x,y+10,30,10);
}

  • Q1:

For the exercise, both PART I and PART II are definitely not any kind of the dynamic ones. For Part I, it fits into the first situation: “Static”, as there is neither internal nor external interaction and changes within, which align with the description “There is no interaction between the two that can be observed by someone else, although the viewer may be experiencing personal psychological or emotional reactions.”(Edmonds 2). For Part II, by adding the array function, there exists some internal communication of data within the program. In this situation , this part can be put into the category between “Dynamic-Passive” and “Static” and there wasn’t much of the modification done with the outside factors.

  • Q2:

The benefit of using array is to ave the effort of repeating similar code again and again. It provides a media for the data to be stored and the changes in the data can lead to changes in the project. It can be used to make some pictures and images in the project.

Leave a Reply

Your email address will not be published. Required fields are marked *