-
Notifications
You must be signed in to change notification settings - Fork 0
/
StarPoints.pde
59 lines (52 loc) · 1.2 KB
/
StarPoints.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
import org.openkinect.*;
import org.openkinect.processing.*;
// Showing how we can farm all the kinect stuff out to a separate class
KinectTracker tracker;
// Kinect Library object
Kinect kinect;
void setup() {
size(640,520);
kinect = new Kinect(this);
tracker = new KinectTracker();
}
void draw() {
background(255);
// Run the tracking analysis
tracker.track();
// Show the image
tracker.display();
//
// // Let's draw the raw location
// PVector v1 = tracker.getPos();
// fill(50,100,250,200);
// noStroke();
// ellipse(v1.x,v1.y,20,20);
//
// // Let's draw the "lerped" location
// PVector v2 = tracker.getLerpedPos();
// fill(100,250,50,200);
// noStroke();
// ellipse(v2.x,v2.y,20,20);
//
// // Display some info
// int t = tracker.getThreshold();
// fill(0);
// text("threshold: " + t + " " + "framerate: " + (int)frameRate + " " + "UP increase threshold, DOWN decrease threshold",10,500);
}
void keyPressed() {
int t = tracker.getThreshold();
if (key == CODED) {
if (keyCode == UP) {
t+=5;
tracker.setThreshold(t);
}
else if (keyCode == DOWN) {
t-=5;
tracker.setThreshold(t);
}
}
}
void stop() {
tracker.quit();
super.stop();
}