I want to rotate each rect by 5° inside a for-loop

edited August 2015 in Questions about Code

dear coders,

i want to rotate each rectangle inside my for-loop. But with this code the programm rotates the whole sketch-matrix. What do i do wrong?

 for (int x = 0; x < width; x=x+20) {
    for (int y = 0; y < height; y=y+20) {

      pushMatrix();
     rotate(radians(5));
      rect(x,y,20,20);
      popMatrix();
    }
  }

Answers

Sign In or Register to comment.