Scaling and dividing circle animation?
in
Programming Questions
•
2 years ago
Hi ya'll,
I'm a beginner in Processing. I am trying to recreate this youtube clip of cancer cells dividing in mitosis for a class project, but in a much more simplified way. I don't know how to create those oblong shapes, so I'm just using the ellipse function instead.
In any case, I've consulted with my professor, and he helped me write this:
float c=100.0;
float d=50.0;
float [] x;
float [] y;
float [] a;
float [] b;
void setup(){
size(400,400);
smooth();
}
void draw(){
background(0);
for (int i=0; i> 100; i++){
c= -10;
x[i]= d-2;
y[i]= d-2;
b[i]=c/2;
a[i]=c/2;
fill(255);
ellipse(x[i], y[i], b[i], a[i]);
}
}
If I understand it right, a for(int) loop is being used to create an ellipse whose radius will be divided by half using these values:
b[i]=c/2;
a[i]=c/2;
Yeah?
I've run the animation but all I get is a black screen. I'm not sure why I'm using an array either, but he said it would be helpful.
Thanks in advance for any suggestions!
I'm a beginner in Processing. I am trying to recreate this youtube clip of cancer cells dividing in mitosis for a class project, but in a much more simplified way. I don't know how to create those oblong shapes, so I'm just using the ellipse function instead.
In any case, I've consulted with my professor, and he helped me write this:
float c=100.0;
float d=50.0;
float [] x;
float [] y;
float [] a;
float [] b;
void setup(){
size(400,400);
smooth();
}
void draw(){
background(0);
for (int i=0; i> 100; i++){
c= -10;
x[i]= d-2;
y[i]= d-2;
b[i]=c/2;
a[i]=c/2;
fill(255);
ellipse(x[i], y[i], b[i], a[i]);
}
}
If I understand it right, a for(int) loop is being used to create an ellipse whose radius will be divided by half using these values:
b[i]=c/2;
a[i]=c/2;
Yeah?
I've run the animation but all I get is a black screen. I'm not sure why I'm using an array either, but he said it would be helpful.
Thanks in advance for any suggestions!
1