Pattern

pattern-01.jpg




PImage img; 
void setup() {
 size(640, 360);
 
 img = loadImage("image.jpg"); // Load the image into the program
}

void draw() {
 
 int teller=0;
 
 for (int i = 0; i <10 ; i= i +1 )
 
 {
 
 for (int j = 0; j <10 ; j= j +1 )
 
 {

teller = teller +1;
 drawImage(i, j, 90*teller);//numbers: place x - place y - rotation in degrees
 
 
}
}
}

void drawImage(int xC, int yC, float myAngle) {
 pushMatrix();
 translate(img.width/2 + 80*xC, img.height/2 + 80*yC );
 rotate(PI/2 * myAngle/90);
 image(img, -img.width/2, -img.height/2 );
 popMatrix();
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s