GMU:Actors, Traces, Collectives/SS17/Zufall

From Medien Wiki
< GMU:Actors, Traces, Collectives‎ | SS17
Revision as of 21:29, 13 August 2017 by Max (talk | contribs) (Max moved page GMU:Actors, Traces, Collectives/Zufall to GMU:Actors, Traces, Collectives/SS17/Zufall: gleicher kurs im WS)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
 


/**
 * Speichert eine SVG Des Inhalts des Rendering Fensters
 * wenn die Maustaste gedrückt wird..
 */


import processing.svg.*;

boolean saveOneFrame = false;
int filenumber = 0;

void setup() {
  size(600, 600);
  frameRate(24);
}

void draw() {
  if(saveOneFrame == true) {
    beginRecord(SVG, "Muster_"+filenumber+".svg"); 
  }
  
  background(255);
  strokeWeight(20.0);
  for(int i = 0;i<30;i++){
    stroke(random(255),random(255),random(255),100);
   line(random(width),random(height),random(width),random(height));
  }
  if(saveOneFrame == true) {
    endRecord();
    saveOneFrame = false; 
  }
}

void mousePressed() {
  saveOneFrame = true; 
  filenumber = filenumber +1;
}