newbie question
in
Programming Questions
•
1 year ago
Hi there!
I'm trying to make a sketch of a growing rectangle. Yes,yes... that's very easy, I can use scale() or change the rectangle dimensions every frame:
rectMode(CENTER);
rect(100, 100, r, r);
r++;
but I want (I need) to do exactly the same effect using translate() funtion (moving the rectangle towards the z-axis). Something like
translate(0,0,z);
rect(100,100,w, h);
z++;
but that works only is the rectangle center is (widht/2, height/2).
What would be the best way to do that?
Any advice would be appreciated...
Thank you!
David
I'm trying to make a sketch of a growing rectangle. Yes,yes... that's very easy, I can use scale() or change the rectangle dimensions every frame:
rectMode(CENTER);
rect(100, 100, r, r);
r++;
but I want (I need) to do exactly the same effect using translate() funtion (moving the rectangle towards the z-axis). Something like
translate(0,0,z);
rect(100,100,w, h);
z++;
but that works only is the rectangle center is (widht/2, height/2).
What would be the best way to do that?
Any advice would be appreciated...
Thank you!
David
1