Created
September 16, 2018 12:24
-
-
Save wonderburg7/758fa1e112720e86c0613527f132ed24 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; // Declare a variable of type PImage | |
int x = 0; | |
int y = 0; | |
int bigdistance = 2000; | |
int distance = 100; | |
int gridpoints = (bigdistance/distance); | |
void setup() { | |
size(2000,2000); | |
background(0); | |
// Make a new instance of a PImage by loading an image file | |
img = loadImage("File 05-08-2018, 21 07 05.png"); | |
img.resize(140,140); | |
} | |
void draw() { | |
for (int j = 0; j < gridpoints-1; j++){ | |
for (int i = 0; i < gridpoints-1; i++){ | |
// Draw the image to the screen at coordinate (0,0) | |
image(img,x,y); | |
//rect(x,y,10,10); | |
x += distance; | |
} | |
if ((x % distance) == 0){ | |
x = (distance/2); | |
} else { | |
x = 0; | |
} | |
y += distance; | |
} | |
save("hexgrid1.png"); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment