-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtornado.pde
More file actions
44 lines (30 loc) · 1.15 KB
/
tornado.pde
File metadata and controls
44 lines (30 loc) · 1.15 KB
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
void tornado(float input1){
alphaCol3 = map(input1, 0, 127, alphaColMin3, 255);
//baseX3[baseX3.length-1] = map(input2, 0, 127, width/2, width/2); //turned off x mapping
translate(width/2, 0);
background(0);
if (spheres3){
noStroke();
fill(partColor3, alphaCol3);
}
else {
noFill();
strokeWeight(partSize3);
stroke(partColor3, alphaCol3);
}
for (int i = 0; i < p3.length; i++){
if(i % chunkSizeSpeed3 == 0 && i/chunkSizeSpeed3 < baseX3.length-1){
baseX3[i/chunkSizeSpeed3] = baseX3[i/chunkSizeSpeed3+1];
currentBaseX3 = baseX3[i/chunkSizeSpeed3];
}
//int iInverse = p.length-1-i;
float v = .2*frameCount+i*.03; //higher number means faster read-through speed, noise smoothness
xShift3[i] = map(noise(v), 0, 1, -float(height)/float(width)*shifted3, float(height)/float(width)*shifted3);
xShift23[i] = map(noise(v-3), 0, 1, -float(height)/float(width)*shifted3, float(height)/float(width)*shifted3);
pushMatrix();
translate(0+xShift3[i] + currentBaseX3, 0, 0+xShift23[i]);
rotateY(radialOffset3[i]);
p3[i].drawParticle3(speedMod3[i]);
popMatrix();
}
}