trickier synthesis moves

This commit is contained in:
benfry
2012-04-08 17:28:29 +00:00
parent 51ae03ee8e
commit 342dd390b5
2 changed files with 26 additions and 0 deletions
@@ -0,0 +1,26 @@
/**
* Synthesis 1: Form and Code,
* Collage Engine by Casey Reas (www.processing.org)
* p. 150
*
* Step 1, working with one image.
*/
// Load the image
PImage nyt01 = loadImage("nyt_01.jpg");
float x, y; // Image position
float r; // Image rotation
size(400, 300);
background(255);
tint(255, 204);
x = random(width); // Set random x-coordinate
y = random(height); // Set random y-coordinate
r = random(0, TWO_PI); // Set random rotation
pushMatrix();
translate(x, y);
rotate(r);
image(nyt01, -nyt01.width/2, -nyt01.height/2);
popMatrix();