We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am using the AveragePointTracking example on the Open Kinect library, but can't figure out how to make an image appear on the screen when you move your hand on a certain location on the screen. I tried if statements with the location but doesn't work either.
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(); }
Answers
Some comments