-
Notifications
You must be signed in to change notification settings - Fork 1
/
scatter.pde
41 lines (33 loc) · 976 Bytes
/
scatter.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
import processing.opengl.*;
import spout.*;
Spout spout;
PVector[] vecs = new PVector[100];
int num = 400;
void setup() {
size(1000,1000,P3D);
for (int i=0; i<vecs.length; i++) {
vecs[i] = new PVector(random(num),random(num),random(num));
}
spout = new Spout(this);
spout.createSender("Processing for Spout", width, height);
}
void draw() {
background(0);
translate(width/2,height/2);
scale(1,-1,1);
rotateY(radians(frameCount));
noFill();
strokeWeight(1);
box(num);
translate(-num/2,-num/2,-num/2);
for (int i=0; i<vecs.length; i++) {
PVector v = vecs[i];
stroke(255,75);
strokeWeight(2);
line(v.x,0,v.z,v.x,v.y,v.z);
stroke(255);
strokeWeight(5);
point(v.x,v.y,v.z);
}
spout.sendTexture();
}