-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpandemia_model.pde
72 lines (42 loc) · 991 Bytes
/
pandemia_model.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import java.util.Comparator;
import java.util.Arrays;
boolean SAVE_IMAGES= false;
float ts=25;
float motion_blur_steps=10;
Pandemia model;
void setup(){
motion_blur_steps=16;
size(540, 540);
//2560x1440 1280 x 720
//size(1280, 720);//Youtube 2K
background(0,0,0);
pixelDensity(2);
frameRate(60);
smooth(4);
float screen_side_len = sqrt(height*width);
ts = screen_side_len/70;
model =new Pandemia(new PVector(width-ts*2, height-ts*2));
}
float minimal_infection = 0.001;
float critical_infection = 0.01;
float lethal_infection = 0.9;
void draw(){
if(frameCount%3==0){
fill(10,10,50, 7);
rect(0,0,width, height);
}
translate(width /2, height /2);
model.draw();
if(frameCount<60*30 && SAVE_IMAGES)
saveFrame("hair_####.png");
}
void mouseReleased() {
looping = !looping;
if (looping) {
loop();
} else {
noLoop();
}
println(frameCount );
saveFrame("hair_####.png");
}