Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int steps = 100;
- float theta;
- float radius = 200;
- float x, y, x2, y2, ox, oy;
- float inner_noise, outer_noise;
- color bg = #000000 ;
- color f = #ffffff;
- void setup() {
- size(500, 500);
- background(bg);
- stroke(f);
- ox = width/2;
- oy = height/2;
- frameRate(20);
- strokeWeight(2);
- }
- void draw() {
- fill(bg, 20);
- rect(0, 0, width, height);
- drawCircle();
- }
- void mouseClicked() {
- setup();
- }
- void drawCircle() {
- for (int i=0; i<steps; i++) {
- inner_noise = random(100, 150);
- outer_noise = random(20, 70);
- x = ox + cos(theta)*(radius-outer_noise);
- y = oy + sin(theta)*(radius-outer_noise);
- x2 = ox + cos(theta)*(radius-inner_noise);
- y2 = oy + sin(theta)*(radius-inner_noise);
- stroke(f, 100);
- stroke(f);
- line(x, y, x2, y2);
- theta += TAU/steps;
- }
- fill(bg);
- noStroke();
- ellipse(ox, oy, 80, 80);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement