-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKinectTracker.pde
More file actions
88 lines (66 loc) · 1.73 KB
/
KinectTracker.pde
File metadata and controls
88 lines (66 loc) · 1.73 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
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
import codeanticode.syphon.*;
SyphonServer serveThis;
//import processing.video.*;
import java.util.Collections;
import traer.physics.*;
ParticleSystem gen;
import org.openkinect.freenect.*;
import org.openkinect.freenect2.*;
import org.openkinect.processing.*;
import org.openkinect.tests.*;
Kinect2 kinect;
ParticleSystem physics;
ParticleThing thing;
Fakinect fakinect;
DepthPlane depthPlane;
PGraphics input;
PGraphics out;
//Movie depthVideo;
PImage depthImage;
void settings() {
size(400,400, P3D);
PJOGL.profile=1;
}
void setup() {
frameRate(30);
out = createGraphics(1024, 848);
out.colorMode(HSB);
gen = new ParticleSystem();
physics = new ParticleSystem();
depthImage = loadImage("data/depth.png");
//depthVideo = new Movie(this, "depth.mp4");
kinect = new Kinect2(this);
kinect.initDepth();
kinect.initIR();
kinect.initVideo();
kinect.initDevice();
input = createGraphics(kinect.depthWidth, kinect.depthHeight);
fakinect = new Fakinect();
depthPlane = new DepthPlane();
//depthVideo.loop();
//depthVideo.volume(0);
thing = new ParticleThing();
serveThis = new SyphonServer(this, "Processing Syphon");
}
void draw() {
background(0);
//camera((mouseX - (width/2))*5, (mouseY - (height/2))*5, 1100, width/2, height/2, 0, 0.0, 1.0, 0.0);
//fakinect.run();
depthImage = kinect.getDepthImage();
input.beginDraw();
input.image(depthImage, 0, 0, input.width, input.height);
input.endDraw();
out.beginDraw();
out.blendMode(BLEND);
out.fill(0,100);
out.blendMode(SCREEN);
out.rect(0,0,out.width,out.height);
depthPlane.run();
thing.run();
out.endDraw();
image(input, 0, 0, width, height);
serveThis.sendImage(out);
}
//void movieEvent(Movie m){
// m.read();
//}