Grid grid; Config conf; int imageNr = 1; int toggle; Camera camera1; void setup() { toggle = 0; conf = new Config(); size(600, 400, P3D); stroke(0); grid = new Grid(this.conf.gridPointsX, this.conf.gridPointsY, this.conf.gridDistX, this.conf.gridDistX, this.conf.gridStartImg); camera1 = new Camera(); } void draw() { background(0); colorMode(RGB, 255); // Blue directional light from the left directionalLight(30, 90, 110, // Color 1, 0, -0.5); // The x-, y-, z-axis direction // Blue directional light from the left directionalLight(60, 110, 105, // Color -1, 0, -0.5); // The x-, y-, z-axis direction // Blue directional light from the left directionalLight(60, 110, 80, // Color 0, 1, -1); // The x-, y-, z-axis direction // Blue directional light from the left directionalLight(255, 255, 255, // Color 0, 0, -1); // The x-, y-, z-axis direction // Blue directional light from the left //pointLight(250,232,170,1,1,-1); camera1.change(grid.getWidth(), grid.getHeight(), grid.getRatio()); grid.movePoints(); grid.drawYourself(toggle); } void keyPressed() { if (key == 'b' && toggle == 1) { toggle = 0; } else if (key == 'b' && toggle == 0) { toggle = 1; } if (key == '1') { grid.changeImage(1); } else if (key == '2') { grid.changeImage(2); } else if (key == '3') { grid.changeImage(3); } else if (key == '4') { grid.changeImage(4); } else if (key == '5') { grid.changeImage(5); } else if (key == '6') { grid.changeImage(6); } else if (key == '7') { grid.changeImage(7); } if (key == 'q') { grid.addCol(); } if (key == 'w') { grid.addLine(); } if (key == 'a') { grid.removeCol(); } if (key == 's') { grid.removeLine(); } if (key == 'e') { grid.elasticPlus(); } if (key == 'd') { grid.elasticMinus(); } if (key == 'r') { grid.speedUp(); } if (key == 'f') { grid.speedDown(); } }