Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Concerning our Microsoft Kinect project, we need some help.

We control a robot with our movements tracked by the Kinect sensor. We display the depth image of the Kinect sensor on our screen, so we see what the sensor is acutally tracking.

Now we want to implement a feature that a user can turn the robot on and off by moving the hand on a specific area drawed on this depth image. You can see this in the image below. The problem now is, that the coordinates of this "on-drawed" ellipse obviously are relative in the 3d-space. I know that there must be any possibility to translate the X-, Y- and Z-coordinates of the hand in the 2d-space, but honestly, I have no idea how to do this. I imagine a kind of "tunnel" from the point of view of the sensor, like in the picture below, which the user must hit. enter image description here enter image description here

I hope that somebody can help us here.

share|improve this question
You could also create a 2d buffer (similar to your output image) for a certain depth and only use the pixels of your hand to find the centroid and determine if it's with in your circle. This of course only works if you hold your hand towards the camera. If the cam sees your complete body the centroid would be around your belly. – Sidar Jan 16 '13 at 22:32
up vote 1 down vote accepted

We found a solution by using the DiABlu NXTComm's function

convertRealWorldToProjective(PVector world, PVector proj);

whichs converts the coordinates like desired. However, even if our problem now is solved, I still wonder how this convertion works in a mathematical way.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.