Created
September 16, 2018 12:26
-
-
Save wonderburg7/44c0658f955f78f608423f091c675344 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PImage img, img1, img2, img3, img4; // Declare a variable of type PImage | |
int x = 0; | |
int y = 0; | |
int bigdistance = 4000; | |
int distance = 400; | |
int gridpoints = (bigdistance/distance); | |
int picheight = int(429/1.5),picwidth = 0; | |
int counter = 1; | |
void setup() { | |
size(4000,4000); | |
// background(255, 123, 41); | |
background(0, 255, 226); | |
//background(237, 26, 150); | |
imageMode(CENTER); | |
img1 = loadImage("Glamour-1-PNG.png"); | |
img2 = loadImage("Glamour-2-PNG.png"); | |
img3 = loadImage("Glamour-3-PNG.png"); | |
img1.resize(picheight,picwidth); | |
img2.resize(picheight,picwidth); | |
img3.resize(picheight,picwidth); | |
noLoop(); | |
} | |
void draw() { | |
for (int j = 0; j < gridpoints+1; j++){ | |
for (int i = 0; i < gridpoints+1; i++){ | |
pushMatrix(); | |
// Make a new instance of a PImage by loading an image file | |
//int random = int(random(4)); | |
/*x = int(random(2000)); | |
y = int(random(2000));*/ | |
if (counter == 1){ | |
img = img1; | |
} else if (counter == 2){ | |
img = img2; | |
} else if (counter == 3){ | |
img = img3; | |
} | |
counter++; | |
if (counter == 4){ | |
counter = 1; | |
} | |
//translate(x+picheight/2,y+picwidth/2); | |
translate(x,y); | |
//translate(img.width/2, img.height/2); | |
//int twisty = int((random(360))); | |
//rotate(radians(int(random(360)))); | |
image(img,0,0); | |
x += distance; | |
popMatrix(); | |
} | |
if ((x % distance) == 0){ | |
x = (distance/2); | |
} else { | |
x = 0; | |
} | |
y += distance; | |
} | |
save("moppes.png"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment