Advertisement
raphael76280

BlackHole

May 6th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.33 KB | None | 0 0
  1. float TAU = PI*2;
  2.  
  3. float r ;
  4. float g;
  5. float b;
  6.  
  7.  
  8.  
  9. void circle(int x, int y, float r){
  10.   int count = round(max(3,min(100,10+abs(r)/3)));
  11.   float[] pointsX = new float[count+2];
  12.   float[] pointsY = new float[count+2];
  13.  
  14.  
  15.   for (int i = 0; i<count+2; i++){
  16.     float a = (TAU/count+frameCount)*i;
  17.     pointsX[i] = (x+cos(a)*r);
  18.     pointsY[i] = (x+sin(a)*r);
  19.   }
  20.  
  21.   for (int i = 0; i < count; i++){
  22.    
  23.     line(pointsX[i], pointsY[i], pointsX[i+1], pointsY[i+1]);  
  24.   }
  25.  
  26. }
  27.  
  28.  
  29. float frame255 = 0;
  30.  
  31. void setup(){
  32.  size(2160,2160);
  33.  background(0);
  34.  
  35.  /*
  36.  r = random(255);
  37.  g = random(255);
  38.  b = random(255);*/
  39.  
  40.  r = 65;
  41.  g = 255;
  42.  b = 255;
  43.  
  44. }
  45.  
  46. void draw(){
  47.   frame255 += frameRate;
  48.   if (frame255 >= 255)
  49.     frame255 = 0;
  50.    
  51.   strokeWeight(1);
  52.   stroke(r+random(255-r)/2,g+random(255-g)/2,b+random(255-b)/2, random(frame255)/50);
  53.   circle(width/2, height/2, 100+sin(frameCount/2)*frameCount+random(100));
  54.  
  55.   if (frameCount % 25 == 0){
  56.     strokeWeight(5);
  57.     stroke(r+random(255-r)/2,g+random(255-g)/2,b+random(255-b)/2, random(frame255)/50);
  58.     circle(width/2, height/2, 250+sin(frameCount/2)*frameCount+random(100));
  59.   }
  60.  
  61.  
  62.  
  63.   /*
  64.   fill(0);
  65.   rect(0,0,50,50);
  66.   fill(255);
  67.   text(frameCount+ " ", 10,10);*/
  68.  
  69.   if (frameCount >= 2000){
  70.     save("Cyan.jpg");
  71.     exit();
  72.   }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement