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

This commit is contained in:
Yannick Francois committed 2018-03-28 21:55:16 +02:00
1 parent 27565541bc
commit 890dc30f56
2 files changed
+63

No files matched your search

+22
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();
}