forked from JesseScott/kinectTag
-
Notifications
You must be signed in to change notification settings - Fork 1
/
OPENNI.pde
50 lines (38 loc) · 1.34 KB
/
OPENNI.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
//-----------------------------------------------------------------------------------------
// SimpleOpenNI events
void onNewUser(int userId) {
println("onNewUser - userId: " + userId);
println(" start pose detection");
if(autoCalib)
context.requestCalibrationSkeleton(userId,true);
else
context.startPoseDetection("Psi",userId);
}
void onLostUser(int userId) {
println("onLostUser - userId: " + userId);
}
void onStartCalibration(int userId) {
println("onStartCalibration - userId: " + userId);
}
void onEndCalibration(int userId, boolean successfull) {
println("onEndCalibration - userId: " + userId + ", successfull: " + successfull);
if (successfull) {
println(" User calibrated !!!");
context.startTrackingSkeleton(userId);
}
else {
println(" Failed to calibrate user !!!");
println(" Start pose detection");
context.startPoseDetection("Psi",userId);
}
}
void onStartPose(String pose,int userId) {
println("onStartPose - userId: " + userId + ", pose: " + pose);
println(" stop pose detection");
context.stopPoseDetection(userId);
context.requestCalibrationSkeleton(userId, true);
}
void onEndPose(String pose,int userId) {
println("onEndPose - userId: " + userId + ", pose: " + pose);
}
//-----------------------------------------------------------------------------------------