How to make the ellipse size change when the ellipse locates toward the center??
hi and welcome
try this and play with this line
ellipse(33+move, 255, 55+move, move+55);
int c = 1;
int move=0;
void setup() {
size(600, 600);
}
void draw() {
background(1,255,1);
move= move + c;
fill(0,0,266);
ellipse(33+move, 255, 55+move, move+55);
if (move>= width || move <= 0 ) {
c= c * -1;
}
}
1 Like
You can calculate the distance to the center with
float d=dist(x,y,width/2,height/2);
and then use map() command
float diam = map(d,0,width,1,55);
use diam as 3rd and 4th parameters for ellipse
2 Likes