Instructions
Nov 29th, 2012 by wilsog2
If you’re here just looking to play the game and don’t care about editing the code, skip down to section 3 and follow the steps for installing the Kinect drivers. That is all you will need to be able to play the game.
Disclaimer:
This guide assumes you are using Windows 7 and will choose Codeblocks as your compiler (its free, don’t worry). All of this can be accomplished on other operating systems and with different compilers, but the instructions will vary and we have not tested to know the ins and outs of each setup procedure for anything different than what we assume you will be using.
What You’ll Need
- Microsoft Kinect Sensor
- Computer with internet connection (to setup, not play the game)
1. Setting up the compiler
The first step to editing this project on your own is setting up a compiler. There are many options you can use to do this: Visual Studio, Codeblocks, xCode, makefiles, etc. For this project, we will show you how to use Codeblocks, a free compiler you can find here (download Codeblocks). Download the file with ‘mingw’ in the name. It should be the bigger of the two files. Conveniently, a setup guide is provide for Codeblocks that you should follow to get the program setup. The guides can be found on this page. Just go to the box for your operating system and follow the corresponding guide under “IDE setup guides.”
Once you have Codeblocks or whichever compiler you chose setup according to the guide, give yourself a pat on the back, you’re ready to move on.
2. openFrameworks
We will now download a c++ developer toolkit, openFrameworks, that will make all this coding possible. The downloads can be found here for your operating system. Extract the ZIP file to wherever you would like.
3. ofxKinect and Kinect Drivers
***If you’re just installing the drivers to play the game, extract the ofxKinect folder anywhere you like since you won’t have the openFrameworks folder.***
You will need to download ofxKinect from here. You can download the files as a ZIP file by clicking on the button that says ZIP with a cloud and an arrow to the left. Once downloaded, extract the folder “ofxKinect-master” to the addons folder of openFrameworks (…./openFrameworks/addons). You should rename it to just “ofxKinect”.
You’re now ready to setup the Microsoft Kinect with your computer. Plug in the Kinect via the USB cable and make sure the LED lights up on the front (you also need to plug in the power cord.) Windows should try to install the drivers for the Kinect, but will most likely fail. This is good, we need to install the drivers that came with ofxKinect, not the ones from Microsoft for our application. Open up the device manager. You can get to this by going into Start menu > Control Panel > Device Manager, or by simply typing Device Manager into the start menu (assuming you are using Windows 7.) Under “Other Devices” there should be an item called “Xbox NUI motor.” Right click on this and click “Update Driver Software…” From here, click “Browse my computer for driver software.” At the next screen, click the Browse button and navigate to the ofxKinect folder you just downloaded. Go into …/ofxKinect/libs/libusb/win/inf and select the xbox nui motor folder. Click OK and then hit Next to install the drivers. Click install at the window that pops up. When the Xbox NUI motor drivers have finished installing, go back to your Device Manager and look under “Human Interface Devices.” There should be an item here called “Xbox NUI Motor” if the drivers have installed correctly. Now scroll back down to “Other Devices.” There should be two new items here, Xbox NUI Audio and Xbox NUI camera. Go through the same install process for the drivers as you did for Xbox NUI motor but navigating to the corresponding folder for each (i.e. select the xbox nui audio folder to install the audio drivers and the xbox nui camera to install the camera drivers.) After these drivers have been installed, you should see all three items under “Human Interface Devices.”
4. Running the example
Now that you have everything downloaded and setup, go into the ofxKinect folder you extracted and placed in openFrameworks. Find the folder called “example” and copy it. Go back to the main openFrameworks folder and open the folder called “apps”. Create a new folder called “myapps” or if it already exists, paste the example here.
If you’re using Codeblocks, start the program and press ‘ctrl + o’ to open a file. Navigate to the example folder you just pasted. Find the file called “ofxKinectExample_win.workspace” and open it. In the build menu up top, there should be an option called “Build and Run.” Give the compiler a little bit of time to build the project. If everything has been setup correctly, a window should open with three video images from the Kinect.
Congratulations! You have successfully setup the software necessary to be able to edit the code for our project and even create your own!
5. Download Coordinate Kinection
To run and be able to edit our program, visit the download link here and download the Coordinate Kinection zip file. Extract the Coordinate Kinection folder to …/openFrameworks/apps/myapps. In Codeblocks, open the file called “coordinatekinection.workspace”. If you build and compile this, you should have the game up and running. The code is heavily commented and should provide you with a sufficient explanation for what everything does.
The executable file “CoordinateKinection.exe” is located in the /bin folder and will allow you to run the game as long as you have the Kinect drivers installed from section 3.