-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTedXSketch6_PointCloud_Sound4_SD5.pde
158 lines (142 loc) · 3.47 KB
/
TedXSketch6_PointCloud_Sound4_SD5.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
// RHYS TURNER
// TedX Particle Could Interactions 2012
// ----- notes ----
// IMPORT ARE IN IMPORT TAB
// PROPERTIES ARE IN PROPERTIES TAB
void setup() {
initProcessing();
initFonts();
initTitleScreen();
initCreditsScreen();
initSound();
//mm = new MovieMaker(this, width, height, "tedX"+now+".mov", 30, MovieMaker.H263, MovieMaker.HIGH);
}
void draw() {
currentFrame ++;
//print(" currentFrame: "+currentFrame/rate);
background(0);
img = new PImage(width,height);
fill(255);
modeSwitch();
//saveImgSeq();
//startRec();
//saveVideoSeq();
//stage 2 sound @48 seconds
//stage 3 sound @140 seconds
//stage 4 sound @200 seconds
if(PLAYBACK_MODE){
if(currentFrame/rate==48){
mode = 2;
}
if(currentFrame/rate==140){
//mode = 3;
}
if(currentFrame/rate==200){
//mode = 4;
}
}else{
if(blobProximity<width && blobProximity>500){
mode = 1;
}
if(blobProximity<500 && blobProximity>300){
mode = 2;
}
if(blobProximity<300 && blobProximity>100){
// mode = 3;
}
if(blobProximity<100 && blobProximity>0){
// mode = 4;
}
}
}
void modeSwitch(){
//play.setVolume(0.5);
switch(mode){
case 0:
//TITLE SCREEN LOOP
if(!titleStarted){
titleStarted = true;
//kinectStarted = false;
ropesStarted = false;
moreRopesStarted = false;
finalStarted = false;
creditsStarted = false;
println("mode:"+mode+" titleStarted "+titleStarted);
}
titleScreenUpdate();
break;
case 1:
if(!kinectStarted){
titleStarted = false;
kinectStarted = true;
ropesStarted = false;
moreRopesStarted = false;
finalStarted = false;
creditsStarted = false;
println("mode:"+mode+" kinectStarted "+kinectStarted);
initKinectCV();
}
ropesNum = 1;
update1();
break;
case 2:
if(!ropesStarted){
titleStarted = false;
//kinectStarted = false;
ropesStarted = true;
moreRopesStarted = false;
creditsStarted = false;
finalStarted = false;
println("mode:"+mode+" initMSAParticles "+ropesStarted);
initPhysics();
//initRopes();
initSpots();
initMSAParticles();
playSoundRate = 20;
}
ropesNum = 1;
update2();
break;
case 3:
if(!moreRopesStarted){
titleStarted = false;
// kinectStarted = false;
ropesStarted = false;
moreRopesStarted = true;
creditsStarted = false;
finalStarted = false;
println("mode:"+mode+" stage 3");
playSoundRate = 5;
ropesNum = 10;
}
update3();
break;
case 4:
//EXPLODE
if(!finalStarted){
titleStarted = false;
//kinectStarted = false;
ropesStarted = false;
moreRopesStarted = false;
creditsStarted = false;
finalStarted = true;
println("mode:"+mode+" finalStarted "+finalStarted);
getPointsFinal();
sampleExplosion2.trigger();
}
update4();
break;
case 5:
//CREDIT SCREEN LOOP
if(!creditsStarted){
creditsStarted = true;
titleStarted = false;
ropesStarted = false;
moreRopesStarted = false;
finalStarted = true;
println("mode:"+mode+" creditsStarted "+creditsStarted);
}
creditsScreenUpdate();
break;
}
}