Sunday, September 29, 2013

Processing 2 example: pushMatrix() and popMatrix()

Example of using pushMatrix() and popMatrix() of Processing 2:



void setup() {  // setup() runs once
  size(400, 300);
  background(255);
}

void draw() {
  
  pushMatrix();
  translate(200, 50);
  ellipse(50, 50, 100, 100);
  popMatrix();
  ellipse(50, 50, 100, 100);
}


1 comment:

  1. I may need to load a library but I can't get your code to run

    void setup() { // setup() runs once
    size(400, 300);
    background(255);
    }

    void draw() {

    pushMatrix();
    translate(200, 50);
    ellipse(50, 50, 100, 100);
    popMatrix();
    ellipse(50, 50, 100, 100);

    Rick

    ReplyDelete