When the Kinect first launched last November, gamers were (to put it charitably) a bit skeptical. Here was a device with incredible technological potential, and the most impressive game that came out with it was a dance simulator.
Still, the Kinect has become a bona fide hit, selling more than eight million units in the first 60 days alone and being named the “fastest-selling consumer electronics device” of all time by Guinness World Records. But more importantly, the software problem has been solved. Not by Microsoft, whose Kinect releases have been few and far between, but by the ever-growing legion of hackers creating innovative tech demos and applications for Kinect on the PC.
If you have a Kinect, you owe it to yourself to see what’s happening in the hacking scene—putting this knowledge to use isn’t even that hard. Follow along and we’ll show you how.
Physically setting up the Kinect is a piece of cake, as long as you have the stand-alone power supply that comes with the boxed version of the Kinect. If you do, just plug in the power supply, connect it to the Kinect, and then run the USB cable over to the PC (don’t plug it in just yet, though).
Unfortunately, if you bought the bundle that includes an Xbox 360 S and the Kinect together, that doesn’t come with a power supply. If you want to use your Kinect with a PC you’ll have to order a stand-alone power supply (above) from Microsoft at bit.ly/heLdOQ.
With the Kinect physically ready to go the plan gets a bit more complicated. You’re going to need to install a total of three things on your system before you can start running software for the Kinect on your PC—one driver, and two pieces of middleware.
Normally, in a situation like this we would want to start with the lowest-level piece of software, the driver. However, in this case, the driver (Sensor Kinect) won’t install without the first piece of middleware (OpenNI), so we’ll start there.
But first, why do we need middleware? Early Kinect hacks relied entirely on rough-around-the-edges drivers that could extract the raw images and depth maps captured by the Kinect sensor. People were able to make some cool hacks using those data streams, but you had to be familiar with image-processing programming in order to do much of anything. OpenNI, from PrimeSense (the Israeli Company that Microsoft licensed the Kinect Technology from in the first place), is middleware that allows developers easier, more abstracted access to sensor data, without having to do the low-level stuff themselves. It’s hardware-agnostic, so OpenNI software will work with any sensor device that has an OpenNI driver written for it. As it stands, Kinect is the only such sensor.
To install OpenNI, just go to the download page at bit.ly/fyjLFy and scroll down until you see the link to download the latest unstable build for Windows. Download and run the installer—there shouldn’t be any surprises here.
With OpenNI installed, you can now use the Sensor Kinect driver. Go to the Sensor Kinect GitHub page at bit.ly/gqWMY9 and click the Downloads button, then click the Download .zip button under Download Source. You won’t have to actually compile any source code, though—just extract the contents of the .zip file and navigate to the Bin/ directory, which contains a binary Windows installer. Run through the quick installer and you’ll be good to go.
At this point, you can plug your Kinect into the computer and perform some quick tests to make sure everything’s on track. First, when you plug in the Kinect, your computer should recognize it for what it is. If you go to the Device Manager, you’ll see a PrimeSensor category that includes a Kinect Motor and Kinect Camera device (below).
OpenNI needs to be configured to run properly, which is handled with a set of XML files in the OpenNI/Data directory. Fortunately, the Sensor Kinect .zip file contains some preconfigured files for you to use. Go back to the directory you extracted the Sensor Kinect source code to, and find the OpenNI folder. Copy the contents of this folder to the Program Files\OpenNI\Data folder.
Finally, open the .xml file you just copied over, because we have to make one more change. In the beginning, there’s a section that reads:
<!-- Add licenses here
<License vendor=”vendor” key=”key”/>
Change this section so that it reads like this:
<License vendor=”PrimeSense” key=”0KOIk2JeIBYClPWVnMoRKn5cdY4=”/>
Don’t worry, it isn’t piracy—this license key is provided by PrimeSense to the community.
Finally, we can run a software test to make sure everything’s working. Go to the folder you installed OpenNI to, then navigate to Samples\Bin\Release and find the file niviewer.exe. When you run this program, you should see a video stream side-by-side with a single-color depth map (above). If you do, you’re more than halfway done.
NITE is another component of the overall PrimeSense package. It’s the higher-level middleware, which interprets the raw sensor data and translates it into more useful constructs—isolating gestures and identifying where your body is. These tools are used by many of the developers creating software for Kinect today.
You can download the latest version of NITE at bit.ly/fsfFEg. The installation is pretty much the same as with OpenNI, except that partway through, you’ll be asked for a license key. Again, use “0KOIk2JeIBYClPWVnMoRKn5cdY4=”.
Once you’ve installed NITE, you’ll have to run through basically the same configuration process as with OpenNI. Go to the Sensor Kinect source directory, find the directory labeled NITE, and copy its contents into the Program Files\Prime Sense\NITE\Data directory. Open each XML file in Notepad, and insert the license key where needed (above).
You can find NITE sample programs in the NITE\Samples\Bin\Release directory. A good one to start with is Sample-Players.exe, which simply shows you a video feed of what the camera sees, with each human it sees shaded in a different color (below).
Congratulations! You’ve hacked your Kinect! Enjoy those Kinect sample applications that came with NITE.
What, you want more? Well, alright. Here are a few programs you can try to get yourself started:
Short for Flexible Action and Articulated Skeleton Toolkit, FAAST lets you control the mouse and keyboard with Kinect. Prepare to live out all your Minority Report fantasies. bit.ly/exTk6O
This package turns the Kinect into a makeshift motion-capture device/3D scanner. It can capture and export skeletal animation or 3D meshes for use in your 3D modeling program of choice (below). bit.ly/eXfiJJ
And just because no list would be complete without a game, here’s Zombie Holdout. Resident Evil it ain’t, but it’s still fun to play a non-Xbox game on Kinect. bit.ly/fRagRi