Fades and Rotation Part 2 - Newbie Help !

edited November 2014 in Programming Questions

Hi all,

I'm trying to get the following going. Perhaps someone could be of assistance.

I'd like to have the first Outer Circle rotate clockwise and disappear while the second outer circle appears then disappears rotating counter clockwise. All the while the inner circle fades from the outside in making it appear to grow and get smaller.

Any suggestions ? Below is my code

All I've seemed to manage is the rotation of the entire image which is not ideal :\ Many thanks

int i = 0;
float  x;
float y;
float angle = 1000;
float r = 5000;
float diff = 5000;

void setup() {
  size(600, 600);
  smooth();
  background(0);
}

void draw() {

  /** Outer Circle*/

  background(0);
  translate(width/2, height/2);
  for (int i= 0; i<150; i++) {
    rotate(r);
    rotate(TWO_PI/150);
    ellipse(100, 100, 4, 4);
    ellipse(103, 103, 4, 4);
    ellipse(105, 105, 4, 4);
    ellipse(107, 107, 4, 4);
    ellipse(109, 109, 4, 4);
    ellipse(111, 111, 4, 4);
    ellipse(113, 113, 4, 4);
    ellipse(115, 115, 4, 4);
    ellipse(117, 117, 4, 4);
    stroke(1);
    strokeWeight(2);

    /** Second Outer*/

    rotate(TWO_PI/172);
    ellipse(128, 128, 5, 5);
    ellipse(131, 131, 5, 5);
    ellipse(133, 133, 5, 5);
    ellipse(135, 135, 5, 5);
    ellipse(137, 137, 5, 5);
    ellipse(139, 139, 5, 5);
    ellipse(141, 141, 5, 5);
    ellipse(143, 143, 5, 5);
    ellipse(145, 145, 5, 5);
    stroke(1);
    strokeWeight(2);

    /** Inner circle*/

    rotate(TWO_PI/50);
    ellipse(4, 4, 4, 4);
    ellipse(6, 6, 4, 4);
    ellipse(8, 8, 4, 4);
    ellipse(10, 10, 4, 4);
    ellipse(12, 12, 4, 4);
    ellipse(14, 14, 4, 4);
    ellipse(16, 16, 4, 4);
    ellipse(18, 18, 4, 4);
    ellipse(20, 20, 4, 4);
    ellipse(22, 22, 4, 4);
    ellipse(24, 24, 4, 4);
    ellipse(26, 26, 4, 4);
    ellipse(28, 28, 4, 4);
    ellipse(30, 30, 4, 4);
    ellipse(32, 32, 4, 4);
    ellipse(34, 34, 4, 4);
    ellipse(36, 36, 4, 4);
    ellipse(38, 38, 4, 4);
    ellipse(40, 40, 4, 4);
    ellipse(42, 42, 4, 4);
    ellipse(44, 44, 4, 4);
    ellipse(46, 46, 4, 4);
    ellipse(48, 48, 4, 4);
    ellipse(50, 50, 4, 4);
    ellipse(53, 53, 4, 4);
    ellipse(56, 56, 4, 4);
    ellipse(58, 58, 4, 4);
    ellipse(60, 60, 4, 4);
    ellipse(62, 62, 4, 4);
    ellipse(64, 64, 4, 4);
    ellipse(66, 66, 4, 4);
    ellipse(68, 68, 4, 4);
    ellipse(70, 70, 4, 4);
    ellipse(72, 72, 4, 4);
    ellipse(74, 74, 4, 4);
    ellipse(76, 76, 4, 4);
    ellipse(78, 78, 4, 4);
    ellipse(80, 80, 4, 4);
    ellipse(82, 82, 4, 4);
    ellipse(84, 84, 4, 4);
    stroke(1);
    strokeWeight(2);
  }

  angle = angle =1000;
  r = r - diff;

  if ( r == 0 || r == 1000) {
    diff =  diff * 5;
  }
}

Answers

This discussion has been closed.