-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDiamond.pde
More file actions
48 lines (46 loc) · 1.17 KB
/
Diamond.pde
File metadata and controls
48 lines (46 loc) · 1.17 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
45
46
47
48
int ampDiamondLeft;
int ampDiamondRight;
boolean diamondLeftOn;
boolean diamondRightOn;
void diamondLeft() {
float damp = 0.95;
int hD = 30;
pushMatrix();
translate(-width/3, 0, hD * 6);
rotateY(HALF_PI);
stroke(0, 0, 255, 255);
fill(0, 0, 255, 63);
box(hD, hD, ampDiamondLeft * .25);
translate(hD, 0);
box(hD, hD, ampDiamondLeft * .5);
translate(hD, 0);
box(hD, hD, ampDiamondLeft);
translate(hD, 0);
box(hD, hD, ampDiamondLeft * .5);
translate(hD, 0);
box(hD, hD, ampDiamondLeft * .25);
ampDiamondLeft *= damp;
if (ampDiamondLeft == 0) diamondLeftOn = false;
popMatrix();
}
void diamondRight() {
float damp = 0.95;
int hD = 30;
pushMatrix();
translate(width/3, 0, hD * 6);
rotateY(HALF_PI);
stroke(255, 0, 0, 255);
fill(255, 0, 0, 63);
box(hD, hD, ampDiamondRight * .25);
translate(hD, 0);
box(hD, hD, ampDiamondRight * .5);
translate(hD, 0);
box(hD, hD, ampDiamondRight);
translate(hD, 0);
box(hD, hD, ampDiamondRight * .5);
translate(hD, 0);
box(hD, hD, ampDiamondRight * .25);
ampDiamondRight *= damp;
if (ampDiamondRight < 0.1) diamondRightOn = false;
popMatrix();
}