We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › scaling an ellipse
Page Index Toggle Pages: 1
scaling an ellipse (Read 467 times)
scaling an ellipse
Nov 10th, 2006, 12:29am
 
im trying to scale and ellipse for it to grow large then come back down to a size and stop at that size...does anyone know how to do this?
thanks.
Re: scaling an ellipse
Reply #1 - Nov 11th, 2006, 7:57pm
 
Code:

float endSize = 200;
float eSize = 0;
boolean grow = true;
void setup(){
size(200, 200);
smooth();
}
void draw(){
background(200);
if(grow && eSize < endSize){
eSize += 5;
} else if(grow && eSize >= endSize){
grow = false;
}
if(!grow && eSize > 0){
eSize -= 5;
}
ellipse(100, 100, eSize, eSize);
}
Page Index Toggle Pages: 1