-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKinect360.pde
100 lines (82 loc) · 1.97 KB
/
Kinect360.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
import queasycam.*;
//Libraries
import org.openkinect.freenect.*;
import org.openkinect.freenect2.*;
import org.openkinect.processing.*;
import org.openkinect.tests.*;
//Processing + 3rd party
PGraphics inputA;
PGraphics inputB;
PImage depthImageA;
PImage depthImageB;
Kinect2 kinectA;
Kinect2 kinectB;
color selectCol = color(100,200,255);
QueasyCam cam;
//My classes
Cloud cloudA;
Cloud cloudB;
//ControlWindow
Controller controls;
void settings() {
size(512, 424, P3D);
PJOGL.profile = 1;
}
void setup() {
//cam = new QueasyCam(this);
//cam.sensitivity = 0.1;
//cam.speed = 1;
//perspective(PI/3, (float)width/height, 0.01, 10000);
controls = new Controller();
stroke(255);
strokeWeight(2);
depthImageA = loadImage("data/depth.png");
depthImageB = loadImage("data/depth.png");
kinectA = new Kinect2(this);
kinectA.initDepth();
kinectA.initIR();
kinectA.initVideo();
kinectA.initDevice(0);
kinectB = new Kinect2(this);
kinectB.initDepth();
kinectB.initIR();
kinectB.initVideo();
kinectB.initDevice(1);
inputA = createGraphics(kinectA.depthWidth, kinectA.depthHeight, P3D);
inputB = createGraphics(kinectB.depthWidth, kinectB.depthHeight, P3D);
//My stuff
cloudA = new Cloud(kinectA.depthWidth, kinectA.depthHeight, 4 );
cloudB = new Cloud(kinectB.depthWidth, kinectB.depthHeight, 1);
}
float r;
float tempr;
void mRot() {
if (mousePressed) {
r = map(tempr, 0, width, 0, TWO_PI);
} else {
tempr = mouseX;
}
}
void test(){
image(kinectA.getDepthImage(), 0, 0, kinectA.depthWidth, kinectA.depthHeight);
rotateY(PI);
translate(-kinectA.depthWidth, 0);
image(kinectB.getDepthImage(), 0, 0);
}
void draw() {
//test();
//translate(width/2 - kinectA.depthWidth/2,0);
background(0);
//float ry = mouseY - (height/2);
//translate(mouseX,ry);
//rotateY(HALF_PI+r);
drawA();
rotateY(PI);
//drawB();
}
void drawA() {
cloudA.scan(kinectA.getRawDepth(), 1);
}
void drawB() {
cloudB.scan(kinectB.getRawDepth(), -1);
}