Hi,
I'm trying to start with processing.
Now I'm just trying to scale a rectangle. I have found this example:
float a = 0.0;
float s = 0.0;
void setup()
{
size(200,200);
rectMode(CENTER);
frameRate(30);
}
void draw()
{
s = s + 0.04;
translate(width/2, height/2);
scale(s);
rect(0, 0, 50, 50);
}
It scales smoothly the rectangle but I'm a bit surprise because for resizing a rectangle I expected the sizing parameters (3rd and 4th) of rect() were modified, something like this way:
float r = 1;
void setup()
{
size(200,200);
rectMode(CENTER);
frameRate(30);
}
void draw(){
rect(width/2, height/2, r, r);
r += 1;
}
but this way doesn't scale the rectangle smoothly. So, should I use the first approach instead of the second one even if I find it the second one more natural? Any comment will be wellcome.
Regards
Javier