//Exercise 3B

//Carly Salindong
//DESMA 28
//11.15.04

 
PImage a; 
int index; 
int x =0;
float y; 
 
void setup() 
{ 
  size(300, 300); 
  a = loadImage("mm.jpg"); 
  framerate(15); 
} 
 
void draw() 
{ 
  
  background(255);
  /*color g = get(20, x);
  fill(g);
  noStroke();
  rect(0, 0, 300, 300);*/
  
  for(int i=0; i<a.width; i++) { 
     color c = a.pixels[int(y)*height + i]; 
     stroke(c); 
     float rval = red(c);
     beginShape(POINTS); 
       vertex(i, y-rval/2); 
       vertex( y-rval/2, i); 
       vertex( y+rval/2, i);
       vertex(y-rval*2, i/2); 
       vertex( y+rval*2, i); 
       vertex(y+rval*2, i/2);
       vertex( y+rval/2, i);
       vertex(y+rval/4, i*2);
       vertex(y+rval*.5, i);
       vertex(i, y+rval/2);
       vertex(i, y+rval/2);
       vertex(y-rval/4, i*2);
       vertex(y-rval*.5, i);  
     endShape();
     
  } 
  
  y = (y+0.5)%a.width; 
} 
 
Exercise 3.B: Image Data
Load a 20x20 pixel image into your program and use the colors in the image as a source of data for generating a kinetic experience amplifying the original image.