• fullscreen
  • sketch36623.pde
  • PVector center;
    float rotation = 0;
    
    void setup() {
      size(800,800);
      rectMode(RADIUS);
      noFill();
      stroke(255);
      center = new PVector(width/2, height/2);//center of the screen
    }
    
    void draw() {
      background(0);
      drawFractal(center, width/2 - 20, rotation);
      rotation += .002;
    }
    
    void drawFractal(PVector center_coor, float side, float rot) {
      pushMatrix();
      translate(center_coor.x, center_coor.x);
      rotate(rot);
      rect(0, 0, side, side);
      if (side > 1)
        drawFractal(new PVector(0, 0), sqrt(2)*side/2, rot);
      popMatrix();
      
    }

    code

    tweaks (0)

    about this sketch

    This sketch is running in HTML5 using Processingjs.

    license

    advertisement

    rebirth

    feeeeeedback

    Add to Faves Me Likey@!
    You must login/register to add this sketch to your favorites.

    just some feedback with rotation. more great things to come..

    You need to login/register to comment.