projet_2_1~20170626-110948.pde 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. float x1 = 0;
  2. float y1 = 0;
  3. float x2 = 500;
  4. float y2 = 0;
  5. float x3 = 500;
  6. float y3 = 500;
  7. float x4 = 0;
  8. float y4 = 500;
  9. float z= 500;
  10. float hu = random(360);
  11. float hi = random(25, 75);
  12. float ha = random(25, 75);
  13. float d = 5; // déplacement des points du carré
  14. float s = 0.2;
  15. void setup() {
  16. colorMode(HSB, 360, 100, 100);
  17. size(1665, 1665, P3D);
  18. fill(0);
  19. rect(0, 0, width, height);
  20. smooth();
  21. noStroke();
  22. }
  23. void draw() {
  24. pushMatrix();
  25. translate(width/(6*-2), (height/(6*-2)));
  26. scale(s);
  27. module();
  28. popMatrix();
  29. pushMatrix();
  30. translate(width/6, (height/(6*-2)));
  31. scale(s);
  32. module();
  33. popMatrix();
  34. pushMatrix();
  35. translate(width/6, height/6);
  36. scale(s);
  37. module();
  38. popMatrix();
  39. pushMatrix();
  40. translate(width/(6*-2), height/6);
  41. scale(s);
  42. module();
  43. popMatrix();
  44. pushMatrix();
  45. translate(width/6, (height/6)*2.5);
  46. scale(s);
  47. module();
  48. popMatrix();
  49. pushMatrix();
  50. translate(width/6, (height/6)*4);
  51. scale(s);
  52. module();
  53. popMatrix();
  54. pushMatrix();
  55. translate(width/6, (height/6)*5.5);
  56. scale(s);
  57. module();
  58. popMatrix();
  59. pushMatrix();
  60. translate(width/(6*-2), (height/6)*2.5);
  61. scale(s);
  62. module();
  63. popMatrix();
  64. pushMatrix();
  65. translate(width/(6*-2), (height/6)*4);
  66. scale(s);
  67. module();
  68. popMatrix();
  69. pushMatrix();
  70. translate(width/(6*-2), (height/6)*5.5);
  71. scale(s);
  72. module();
  73. popMatrix();
  74. pushMatrix();
  75. translate((width/6)*2.5, height/6);
  76. scale(s);
  77. module();
  78. popMatrix();
  79. pushMatrix();
  80. translate((width/6)*2.5, height/(6*-2));
  81. scale(s);
  82. module();
  83. popMatrix();
  84. pushMatrix();
  85. translate((width/6)*4, height/(6*-2));
  86. scale(s);
  87. module();
  88. popMatrix();
  89. pushMatrix();
  90. translate((width/6)*5.5, height/(6*-2));
  91. scale(s);
  92. module();
  93. popMatrix();
  94. pushMatrix();
  95. translate((width/6)*2.5, (height/6)*2.5);
  96. scale(s);
  97. module();
  98. popMatrix();
  99. pushMatrix();
  100. translate((width/6)*2.5, (height/6)*4);
  101. scale(s);
  102. module();
  103. popMatrix();
  104. pushMatrix();
  105. translate((width/6)*2.5, (height/6)*5.5);
  106. scale(s);
  107. module();
  108. popMatrix();
  109. pushMatrix();
  110. translate((width/6)*4, (height/6));
  111. scale(s);
  112. module();
  113. popMatrix();
  114. pushMatrix();
  115. translate((width/6)*4, (height/6)*2.5);
  116. scale(s);
  117. module();
  118. popMatrix();
  119. pushMatrix();
  120. translate((width/6)*4, (height/6)*4);
  121. scale(s);
  122. module();
  123. popMatrix();
  124. pushMatrix();
  125. translate((width/6)*4, (height/6)*5.5);
  126. scale(s);
  127. module();
  128. popMatrix();
  129. pushMatrix();
  130. translate((width/6)*5.5, (height/6));
  131. scale(s);
  132. module();
  133. popMatrix();
  134. pushMatrix();
  135. translate((width/6)*5.5, (height/6)*2.5);
  136. scale(s);
  137. module();
  138. popMatrix();
  139. pushMatrix();
  140. translate((width/6)*5.5, (height/6)*4);
  141. scale(s);
  142. module();
  143. popMatrix();
  144. pushMatrix();
  145. translate((width/6)*5.5, (height/6)*5.5);
  146. scale(s);
  147. module();
  148. popMatrix();
  149. if (keyPressed) {
  150. if (key == 's')
  151. saveFrame("imag_####.png");
  152. }
  153. }