import megamu.mesh.*; import java.io.File; PImage img, qrcode; ArrayList files = new ArrayList(); void setup() { size(1311, 567, P3D); stroke(0); noStroke(); smooth(); qrcode = loadImage("_qrcode.png"); String path = sketchPath + "/data"; File folder = new File(path); File[] listOfFiles = folder.listFiles(); for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile() && !listOfFiles[i].getName().equals("_qrcode.png")) { files.add(listOfFiles[i].getName()); } } } void draw() { background(0); int cloudSize = 20; //Generate point cloud float[][] points = new float[cloudSize][2]; for(int i = 0; i < cloudSize; i++) { points[i][0] = random(0, width); points[i][1] = random(0, height); } Delaunay myDelaunay = new Delaunay( points ); ArrayList tris = getTriangles(myDelaunay, cloudSize); int r, g, b; do { r = (int)random(0, 255); g = (int)random(0, 255); b = (int)random(0, 255); } while(r<200 && g<200 && b<200); for(int j=0; j0) { beginShape(); tint(random(r-variation, r+variation), random(g-variation, g+variation), random(b-variation, b+variation)); texture(img); vertex(points[tri[0]][0], points[tri[0]][1], 0, map(points[tri[0]][0], 0, width, 0, img.width), map(points[tri[0]][1], 0, width, 0, img.width) ); vertex(points[tri[1]][0], points[tri[1]][1], 0, map(points[tri[1]][0], 0, width, 0, img.width), map(points[tri[1]][1], 0, width, 0, img.width)); vertex(points[tri[2]][0], points[tri[2]][1], 0, map(points[tri[2]][0], 0, width, 0, img.width), map(points[tri[2]][1], 0, width, 0, img.width)); endShape(); } } strokeWeight(7); float[][] myEdges = myDelaunay.getEdges(); stroke(0); for(int i=0; i