I become a bit obsessive when learning new things, my curiosity takes over and I find myself up at 4am hacking my way into oblivion. At this point in my Kinect hacking adventures, I’m on the hunt for a middle-ware visual solution that works best for my creative ideas. There are so many to choose from and it seems I must try them all before I can settle on one. This posting is a continuance from a past posting, Setting up Kinect on OSX 10.8 (Mountain Lion), where I describe the basic process of connecting a Kinect hardware controller to a Mac running OSX 10.8. At the end of the installation, I added information on setting up the Processing IDE. Today, I’m going to cover the basics on getting openFrameworks up and running with the libfreenect library.
OpenFrameworks is an open source creative coding platform written in c/c++ that is a powerful, modular toolkit for creative visual artists. Artists use it in a variety of applications from large scale environments to stand alone visual expressions.
Please read the following post if you have not already installed Xcode or libfreenect. You will need Xcode to compile openFrameworks and libfreenect to communicate with the Kinect.
Assuming that you are all set up, let’s get into the action!
Download openFrameworks. Once downloaded, extract and place the folder in a location on your hardrive. For simplicity and organizational sake, I renamed the extracted folder to “openFrameworks” and placed it at
(the step is optional) /Users/”your_user_name”/Documents. The first thing we want to do is to compile and run an example app to make sure openFramemwork works. Navigate to your openFrameworks folder and locate the “examples” folder. Select the graphics/graphicsExample/graphicsExample.xcodeproj file and double click.
This will spawn the Xcode IDE. Navigate to Product>Clean to avoid compile errors. Hit the Run button on the upper left corner of the IDE. When the compile is complete you should be starring at this:
Select the “Esc” key on your keyboard, to terminate the program. If you would like more info on how to use Xcode with openFrameworks, there is a wealth of good information here.
Next we need to Download ofxKinect. Extract the folder and place it in (path)/addons or in my case :
I renamed the extracted file “ofxKinect-master” to “ofxKinect”, so you should have a file path like so:
You may have noticed the other ofx folders in the “addons” folder. Here’s a repository to other ofx add ons that may interest you, have a look around.
Next navigate to ‘/Users/”your_user_name”/Documents/openFrameworks/addons/ofxKinect/examples’ folder and double click on “ofxKinectExample.xcodeproj” file. This will open a new Xcode IDE window, navigate to Product>Clean to avoid compile errors. Connect your Kinect hardware to your Mac’s usb port and hit the Run button on the upper left corner of the IDE. When the compile is complete you should be starring at something similiar to this:
There you have it, a simple way to get libfreenect + openFrameworks communicating.