"examples/processing/triangle16_wavefronts/OPC.pde" did not exist on "1c9e6b85396bf6879c467fb3b6de4b625cd6edc9"
Newer
Older
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
// April Arcus, 2014
int numParticles = 10;
OPC opc;
PImage dot;
PImage planck;
KtoRGB KtoRGB;
TriangleGrid triangle;
Particle[] particles;
float heat;
void setup()
{
size(300, 300, P3D);
//frameRate(10);
heat = 8000;
dot = loadImage("dot.png");
KtoRGB = new KtoRGB();
// Connect to the local instance of fcserver
opc = new OPC(this, "127.0.0.1", 7890);
// Map our triangle grid to the center of the window
triangle = new TriangleGrid();
triangle.grid16();
triangle.mirror();
triangle.rotate(radians(60));
triangle.scale(height * 0.2);
triangle.translate(width * 0.5, height * 0.5);
triangle.leds(opc, 0);
particles = new Particle[numParticles];
for (int i=0; i < particles.length; i++) {
particles[i] = new Particle(random(height),heat);
}
}
void draw()
{
background(0);
for (int i = 0; i < particles.length; i++) {
if (particles[i].center.x < 0 || particles[i].center.x > width ||
particles[i].center.y < 0 || particles[i].center.y > height ||
particles[i].temperature < 800) {
particles[i] = new Particle(height-50,heat);
}
particles[i].draw();
}
}