Skip to content

Instantly share code, notes, and snippets.

@wonderburg7
Created September 16, 2018 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wonderburg7/758fa1e112720e86c0613527f132ed24 to your computer and use it in GitHub Desktop.
Save wonderburg7/758fa1e112720e86c0613527f132ed24 to your computer and use it in GitHub Desktop.
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