Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int slices = 16;
- int pieces = 5;
- int num=slices*pieces;
- float[] r = new float[num];
- int c;
- float scal, theta, sw;
- void setup() {
- size(400, 400);
- noFill();
- strokeCap(SQUARE);
- randomSeed(36);
- for (int i=0; i<slices; i++) {
- for (int j=0; j<pieces; j++) {
- r[c] = random(j*(width/pieces), (j+1)*(width/pieces));
- c++;
- }
- }
- }
- void draw() {
- //background(#202020);
- fill(#202020, 15);
- noStroke();
- rect(0,0,width, height);
- stroke(255);
- noFill();
- c=0;
- for (int i=0; i<slices; i++) {
- sw = map(sin(theta+(TWO_PI/num)*c), -1, 1, 5, 80);
- for (int j=0; j<pieces; j++) {
- scal = map(sin(theta+(TWO_PI/num)*c), -1, 1, 1, 3);
- strokeWeight(sw);
- arc(width/2, height/2, r[c]*scal, r[c]*scal, (TWO_PI/slices)*i, (TWO_PI/slices)*(i+.7));
- c++;
- }
- }
- theta += 0.0523;
- fill(#ffffff);
- noStroke();
- ellipse(width/2, height/2, 50, 50);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement