Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float TAU = PI*2;
- float r ;
- float g;
- float b;
- void circle(int x, int y, float r){
- int count = round(max(3,min(100,10+abs(r)/3)));
- float[] pointsX = new float[count+2];
- float[] pointsY = new float[count+2];
- for (int i = 0; i<count+2; i++){
- float a = (TAU/count+frameCount)*i;
- pointsX[i] = (x+cos(a)*r);
- pointsY[i] = (x+sin(a)*r);
- }
- for (int i = 0; i < count; i++){
- line(pointsX[i], pointsY[i], pointsX[i+1], pointsY[i+1]);
- }
- }
- float frame255 = 0;
- void setup(){
- size(2160,2160);
- background(0);
- /*
- r = random(255);
- g = random(255);
- b = random(255);*/
- r = 65;
- g = 255;
- b = 255;
- }
- void draw(){
- frame255 += frameRate;
- if (frame255 >= 255)
- frame255 = 0;
- strokeWeight(1);
- stroke(r+random(255-r)/2,g+random(255-g)/2,b+random(255-b)/2, random(frame255)/50);
- circle(width/2, height/2, 100+sin(frameCount/2)*frameCount+random(100));
- if (frameCount % 25 == 0){
- strokeWeight(5);
- stroke(r+random(255-r)/2,g+random(255-g)/2,b+random(255-b)/2, random(frame255)/50);
- circle(width/2, height/2, 250+sin(frameCount/2)*frameCount+random(100));
- }
- /*
- fill(0);
- rect(0,0,50,50);
- fill(255);
- text(frameCount+ " ", 10,10);*/
- if (frameCount >= 2000){
- save("Cyan.jpg");
- exit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement