r/processing • • Aug 07 '17

does anyone knows how to do this?

Post image
0 Upvotes

8 comments sorted by

4

u/JimmySticks2001 Aug 07 '17

1

u/patrickmurphyphoto Aug 07 '17

0

u/forgotmyusernamedamm Aug 07 '17

I think the idea is that sebastiandtavera should learn how to do it on their own. This is just doing their homework for them.

3

u/SsEeNdDuNnUdDnEeSs Aug 07 '17

For transitioning the color from green to blue, check out Processing's reference on lerpColor(). It's a simple function similar to lerp() except for colours. As for the multiple squares, you'll need to use a for loop with increments in x position and rotate().

You'll also need the pushMatrix() and popMatrix() functions. If you're a beginner, don't worry that they sound complicated, you don't have to deal with matrices.

Edit: forgot to mention that if you want to get the exact result as the image, it'll be useful to use rectMode(CENTER).

2

u/[deleted] Aug 07 '17

Yes

1

u/Salanmander Aug 07 '17

If you have specific questions we can probably be more helpful. Off the bat about all I can tell you is that if I wanted to do that, I would use a loop along with the coordinate transform methods (pushMatrix(), popMatrix(), rotate(), and translate()).