Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.