Why is this sketch generating janky lines?
in
Programming Questions
•
3 months ago
- void setup(){
- size(800, 800);
- background(235);
- smooth();
- drawRect(width/2, height/2, 200);
- }
- void drawRect(float x, float y, float len){
- pushMatrix();
- translate(x, y);
- rotate(radians(45.0));
- stroke(0);
- strokeWeight(1);
- noFill();
- rectMode(RADIUS);
- rect(0, 0, len, len);
- popMatrix();
- if(len >= 20){
- drawRect(x + len, y, len / 2);
- drawRect(x - len, y, len / 2);
- drawRect(x, y + len, len / 2);
- drawRect(x, y - len, len / 2);
- }
- }
1