wonderburg7
9/16/2018 - 12:24 PM

Load image resize and put into hex grid.pde

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");
}