Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int slices = 40;
- float pie_slice = TWO_PI/slices;
- float x, y, szX, szY, theta, theta2;
- void setup() {
- size(500, 500);
- noStroke();
- }
- void draw() {
- background(240);
- fill(20,150);
- x = width/3;
- y = map(sin(theta), -1, 1, 100, 180);
- float edge = height/10;
- szY = y - edge ;
- szX = 500;
- for (int i=0; i<slices; i++) {
- pushMatrix();
- translate(width/2, height/2);
- rotate(i*pie_slice);
- arc(x, y, szX, szY*2, (PI*1.5)-(pie_slice/2), (PI*1.5)+(pie_slice/2));
- popMatrix();
- }
- theta += 0.0523;
- x = width/5;
- y = map(sin(-theta*2), -1, 1, 100, 200);
- edge = height/10;
- szY = y - edge ;
- szX = 500;
- for (int i=0; i<slices; i++) {
- pushMatrix();
- translate(width/2, height/2);
- rotate(i*pie_slice);
- arc(x, y, szX, szY*2, (PI*1.5)-(pie_slice/2), (PI*1.5)+(pie_slice/2));
- popMatrix();
- }
- theta2 -= 0.0523;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement