i want to scale the screen content slowly to the (pseudo)back, using a 2d scale (shrinking).
here is what i have as start out;
int siz = 66;
void setup(){
size(800,600);
}
void draw(){
ellipse((int)random(width), (int)random(height),siz,siz);
}
this constantly created content should scale (seemingly) backwards, endlessly as new objects are generated…
kll
November 22, 2019, 10:59am
2
https://processing.org/reference/scale_.html
would be more easy, but only if centered,
__
float zoom=100;
void setup(){}
void draw() {
translate(width/2,height/2);
circle(0,0,zoom);
zoom*=0.95;
}
might be other way.
thanks for getting back to my question!
well, i mean the animation;
how to separate a certain object animation (shrinking) to generate them again and again to the stage.
i’ve seen something like this using a PVector[] array which seemed great, but could get the syntax right…
kll
November 22, 2019, 11:21am
4
not understand, but with
zoom*=0.95;
if ( zoom < 0.05 ) zoom = 100;
it runs again and again
if that is what you call animation?
kll:
float zoom=100; void setup(){} void draw() { translate(width/2,height/2); circle(0,0,zoom); zoom*=0.95; }
this zoom* is good either. thank you!
1 Like
how can i make each circle zoom animation from beginning to end?
float zoom=100;
int count;
void setup(){
size(555,555);
}
void draw() {
count+=1;
if(count==10){
elli((int)random(width),(int)random(height));
count=0;
}
}
void elli(int x, int y){
//translate(width/2,height/2);
ellipse(x,y,zoom,zoom);
zoom*=0.95;
}