Hello,
I am very new to processing and would be grateful if I got some help with my assignment. I have took on a project to create something like this animation in processing. I have little to no idea how to come up with the code, but here’s what I started. The grey circles meet the red circle on the circumference. I’m looking to add more circles to this but I am stuck. I’ll include some gifs to explain this better, any help is appreciated.
`int cx = 250;
int cy = 250;
int ax = 250;
int ay = 150;
int r = 100;
float period = 360;
float amplitude = 100;
void setup()
{
size(500, 500);
}
void draw()
{
background(240);
stroke(255);
fill(255,255,255);
ellipse(250,250,200,200);
float t = millis() / 960.00f;
int x = (int)(cx+rcos(t));
int y = (int)(cy+rsin(t));
fill(255,0,0);
ellipse(x,y,10,10);
float x1 = amplitude * cos(TWO_PI * frameCount / period);
stroke(0);
fill(175);
translate(width/2,height/2);
ellipse(x1,0,10,10);
float y1 = amplitude * sin(TWO_PI * frameCount / period);
stroke(0);
fill(175);
translate(0,0);
rotate(0);
ellipse(0,y1,10,10);
}
`