float x1 = 0; float y1 = 0; float x2 = 500; float y2 = 0; float x3 = 500; float y3 = 500; float x4 = 0; float y4 = 500; float z= 500; float hu = random(360); float hi = random(25, 75); float ha = random(25, 75); float d = 5; // déplacement des points du carré float s = 0.2; void setup() { colorMode(HSB, 360, 100, 100); size(1665, 1665, P3D); fill(0); rect(0, 0, width, height); smooth(); noStroke(); } void draw() { pushMatrix(); translate(width/(6*-2), (height/(6*-2))); scale(s); module(); popMatrix(); pushMatrix(); translate(width/6, (height/(6*-2))); scale(s); module(); popMatrix(); pushMatrix(); translate(width/6, height/6); scale(s); module(); popMatrix(); pushMatrix(); translate(width/(6*-2), height/6); scale(s); module(); popMatrix(); pushMatrix(); translate(width/6, (height/6)*2.5); scale(s); module(); popMatrix(); pushMatrix(); translate(width/6, (height/6)*4); scale(s); module(); popMatrix(); pushMatrix(); translate(width/6, (height/6)*5.5); scale(s); module(); popMatrix(); pushMatrix(); translate(width/(6*-2), (height/6)*2.5); scale(s); module(); popMatrix(); pushMatrix(); translate(width/(6*-2), (height/6)*4); scale(s); module(); popMatrix(); pushMatrix(); translate(width/(6*-2), (height/6)*5.5); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*2.5, height/6); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*2.5, height/(6*-2)); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*4, height/(6*-2)); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*5.5, height/(6*-2)); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*2.5, (height/6)*2.5); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*2.5, (height/6)*4); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*2.5, (height/6)*5.5); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*4, (height/6)); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*4, (height/6)*2.5); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*4, (height/6)*4); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*4, (height/6)*5.5); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*5.5, (height/6)); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*5.5, (height/6)*2.5); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*5.5, (height/6)*4); scale(s); module(); popMatrix(); pushMatrix(); translate((width/6)*5.5, (height/6)*5.5); scale(s); module(); popMatrix(); if (keyPressed) { if (key == 's') saveFrame("imag_####.png"); } }