Ajout d'exemple de boucing ball et d'export en SVG

This commit is contained in:
Yannick Francois
2018-03-28 21:54:36 +02:00
parent 27565541bc
commit 890dc30f56
2 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,22 @@
import processing.svg.*;
void setup() {
size(400, 400);
noLoop();
background(220, 220, 220);
beginRecord(SVG, "/home/yaf/filename.svg");
}
void draw() {
for(int i = 0; i < 10; i++) {
int rouge = int(random(250)) % 255;
int vert = int(random(230)) % 255;
int bleu = int(random(250)) % 255;
color couleur_du_moment = color(rouge, vert, bleu);
fill(couleur_du_moment);
quad(int(random(width)), int(random(height)), int(random(width)), int(random(height)), int(random(130)), int(random(163)), int(random(180)), int(random(176)));
}
endRecord();
}