mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
trickier synthesis moves
This commit is contained in:
+26
@@ -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();
|
||||
Reference in New Issue
Block a user