Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- color bg = #37324A;
- color f = #F3A358;
- color s = f;
- int steps = 50;
- int isteps = steps/2;
- float iRadius, org_x, org_y, theta;
- Circle[] innerCircles = new Circle[isteps];
- void setup() {
- size(500, 500);
- background(bg);
- rectMode(CENTER);
- org_x = width/2;
- org_y = height/2;
- theta = 0;
- iRadius = width/6;
- for (int i=0; i < isteps; i++) {
- int dir = -1;
- innerCircles[i] = new Circle(theta, dir, iRadius);
- theta += TAU/isteps;
- }
- }
- void draw() {
- background(bg);
- for (int i=0; i<innerCircles.length; i++) {
- innerCircles[i].run();
- }
- //if (frameCount % 1 == 0 && frameCount < 19) saveFrame("image-####.gif");
- }
- class Circle {
- float x, y, sz, theta, theta2, radius;
- int dir;
- Circle(float _theta, int _dir, float _radius) {
- theta = _theta;
- dir = _dir;
- radius = _radius;
- }
- void run() {
- move();
- display();
- }
- void move() {
- x = org_x + sin(theta)*radius;
- y = org_y + cos(theta)*radius;
- theta += 0.0523/4*dir;
- }
- void display() {
- sz = 200;
- noStroke();
- fill(f, 30);
- ellipse(x, y, sz, sz);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement