Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. PVector v1 = new PVector();
  2. PVector v2 = new PVector();
  3.  
  4. float time = 0;
  5. float time2 = 0;
  6. float time3 = 0;
  7. float time4 = 0;
  8.  
  9. float[] wave = new float[0];
  10. float[] wave2 = new float[0];
  11. float[] wave3 = new float[0];
  12. float[] wave4 = new float[0];
  13. float[] wave5 = new float[0];
  14. float[] wave6 = new float[0];
  15. float[] wave7 = new float[0];
  16.  
  17. float x = 0;
  18. float y = 0;
  19. float x2 = 0;
  20. float y2 = 0;
  21. float x3 = 0;
  22. float y3 = 0;
  23. float x4 = 0;
  24. float y4 = 0;
  25.  
  26. float timeup = random(0.0, 0.2);
  27. float time2up = random(0.0, 0.2);
  28. float time3up = random(0.0, 0.2);
  29. float time4up = random(0.0, 0.2);
  30.  
  31. float xlerp = 0;
  32. float ylerp = 0;
  33. float xlerpnew = 0;
  34. float ylerpnew = 0;
  35.  
  36. float xyr1 = random(0,5);
  37. float xyr2 = random(0,5);
  38. float xyr3 = random(0,5);
  39. float xyr4 = random(0,5);
  40. float xyr5 = random(0,5);
  41. float xyr6 = random(0,5);
  42. float xyr7 = random(0,5);
  43. float xyr8 = random(0,5);
  44.  
  45.  
  46. void setup() {
  47. size(1000, 1000);
  48. ellipseMode(CENTER);
  49. //noLoop();
  50. }
  51.  
  52. void draw() {
  53. background(36, 47, 64);
  54. float radius = 100;
  55.  
  56.  
  57. stroke(204, 164, 59);
  58. noFill();
  59.  
  60.  
  61. // ellipse(100, width/2, radius*2, radius*2);
  62. // ellipse( width/2, 100, radius*2, radius*2);
  63. // ellipse( width-100, width/2, radius*2, radius*2);
  64.  
  65.  
  66. x = radius*xyr1 * cos(time);
  67. y = radius*xyr2 * sin(time);
  68. x2 = radius*xyr3 * cos(time2);
  69. y2 = radius*xyr4 * sin(time2);
  70. x3 = radius*xyr5 * cos(time3);
  71. y3 = radius*xyr6 * sin(time3);
  72. x4 = radius*xyr7 * cos(time4);
  73. y4 = radius*xyr8 * sin(time4);
  74. wave = splice(wave, y, 0);
  75.  
  76. wave2 = splice(wave2, x2, 0);
  77. wave3 = splice(wave3, x3, 0);
  78.  
  79. wave4 = splice(wave4, lerp(x3+100, x4+width/2, 0.5), 0);
  80. wave5 = splice(wave5, lerp(y3+width/2, y4+100, 0.5), 0);
  81.  
  82. xlerp = lerp(x3+100, x4+width/2, 0.5);
  83. ylerp = lerp(y3+width/2, y4+100, 0.5);
  84.  
  85. xlerpnew = lerp(xlerp, x3+width-100, 0.5);
  86. ylerpnew = lerp(ylerp, y3+width/2, 0.5);
  87.  
  88. wave6 = splice(wave6, lerp(xlerp, x3+width-100, 0.5), 0);
  89. wave7 = splice(wave7, lerp(ylerp, y3+width/2, 0.5), 0);
  90.  
  91. //ellipse(xlerpnew, ylerpnew, 8, 8);
  92.  
  93.  
  94. pushMatrix();
  95. translate(0-100,0+100);
  96. beginShape();
  97. for (int i = 0; i < wave.length; i++) {
  98. //vertex(wave2[i]+gridx, wave[i]+gridy);
  99. //vertex(wave4[i], wave5[i]);
  100. vertex(wave6[i], wave7[i]);
  101. }
  102. endShape();
  103. popMatrix();
  104.  
  105.  
  106. //THese are the little circles on the circles
  107.  
  108. // ellipse(x+100, y+width/2, 8, 8);
  109. //ellipse(x2+width/2, y2+100, 8, 8);
  110. // ellipse(x3+width-100, y3+width/2, 8, 8);
  111.  
  112. // line(x+100,y+width/2, x2+width/2, y2+100);
  113. lerp(x+100, x2+width/2, 0.5);
  114. lerp(y+width/2, y2+100, 0.5);
  115.  
  116. time += timeup;
  117. time2 -= time2up;
  118. time3 += time3up;
  119. time4 -= time4up;
  120. }
  121.  
  122. void mouseClicked() {
  123. save("patterns"+frameCount+".png");
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement