import processing.pdf.*; /////////////////////////////// int x = 0; int y = 0; int x2 = 0; int y2 = 0; int humeur = 0; int frame = 0; boolean record = false; int recording = 0; color c = color(random(255),random(255),random(255)); int printo = 1; int nbPass = int(random(1,2)); //////////////////////////// void setup(){ size(1000,800); background(255); //frameRate (5); refresh(); } void draw(){ if (record) { beginRecord(PDF, printo + ".pdf"); record =! record; recording = 1; println("Start Save : "+printo); } ///////////////////////////////////////////////////// draw1(); draw2(); ///////////////////////////////////////////////////// if(frameCount>frame+nbPass){ if(recording == 1){ endRecord(); println("Finish : "+printo); record =! record; recording = 0; printo++; } refresh(); } } ////////////////////////////////////////////////// void refresh(){ c = color(random(255),random(255),random(255)); nbPass = int(random(1,20)); background(255); frame = frameCount; } /////////////////////////////////////////////////// void draw1(){ stroke(c); y = 0; x += random(width/5); for(int i=0; i= 10){ rect(x+(4*a),y,0.1,0.1); rect(x+(4*a),y,0.1,0.1); } } //rect(x,y,0.1,0.1); } if((x>width) || (x<-100)){ x=-100; } } /////////////////////////////////////////////////////// void draw2(){ stroke(c); y2 += humeur; x2 = 0; for(int i=0; i= 10){ rect(x2,y2+(2*a),0.1,0.1); rect(x2+2,y2+(2*a),0.1,0.1); } } } if((y2>height) || (y2<-100)){ y2=-100; } } //////////////////////////////////////////////////////// void mousePressed() { record =! record; } ////////////////////////////////////////////////////