I thought it would be easier to control rotations and speed and so on, since you have math functions with vectors, that allow you to calculate distances, angles, add coordinates and so on.
I`ve been trying now for an hour but cant really get it moving.
Code:
PVector ring, radius;
PVector angle, acceleration;
void setup()
{
size(500,500);
smooth();
noStroke();
ring = new PVector(0,0);
radius = new PVector(100,50);
angle = new PVector(1,1);
acceleration = new PVector(10,10);
}
void draw()
{
fill(0,2);
rect(0,0,width,height);
translate(width/2,height/2);
drawRing();
rotateRing();
println(ring.x + " " + ring.y)
}
void drawRing()
{
for(int i=0; i<60; i++)
{
float phase = i*1./60;
float pointSize = abs(sin(phase)*TWO_PI);
fill(255,255*phase,155);
ring.x = ring.x + radius.x*cos(phase*TWO_PI);
ring.y = ring.y + radius.y*sin(phase*TWO_PI);
ellipse(ring.x,ring.y,pointSize,pointSize);
}
}
void rotateRing()
{
angle.add(acceleration);
ring.add(angle);
}
Now I`ll to try the angleBetween-function to add angles togeter....