A simple interactive visual effect using Microsoft's Kinect and Cinder.
Currently the system is limited to 5000 particles. When I get the chance, I intend to implement a particle system that uses location binning to limit particle interactions to nearest neighbor interactions. This will probably raise the particle capacity to 14k particles @ 30fps. GPU based techniques would be needed to implement a larger number of particles.
To date, the only environment I have tested this on is the following:
- Mac OS X 10.6.7
- Xcode 3.2.6
- Homebrew 0.8
- libusb with OpenKinect patch. Homebrew formula
- OpenNI-Binaries v1.1.0.41
- SensorKinect v5.0.1.32
- NITE-MiddleWare Binaries v1.3.1.5
- Cinder HEAD
- And of course: A Kinect (no seriously, it will not run without a kinect plugged into the computer.)
-
If you haven't already downloaded and installed Xcode 3.2.6, Grab it here. I have not tested this with Xcode 4. You will need to log in.
-
Fire up Terminal.app and install Homebrew and git
ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)"
brew install git
- Then install libusb
brew install https://github.com/OpenKinect/libfreenect/raw/unstable/platform/osx/homebrew/libusb-freenect.rb
- Create a link between /usr/local and /opt/local to fool NITE into thinking we like macports.
ln -s /usr/local /opt/local
- Install OpenNI using the following steps:
1. Download the package.
2. extract the package into its own directory.
3. `cd` to that directory in the terminal and run
sudo ./install.sh
- Repeat Step 5. for NITE and SensorKinect
Now that you have a working install of OpenNI and NITE we need to download and build Cinder.
- Make a directory on your desktop and call it
CinderProjects
cd ~/Desktop
mkdir CinderProjects
- Clone cinder's git repository
cd ~/Desktop/CinderProjects
git clone git://github.com/cinder/Cinder.git Cinder
-
Download the compatible version of boost(v1.44.0) Extract it, and rename the directory to
boost
. Copy this directory to~/Desktop/CinderProjects/Cinder
. -
Build Cinder:
cd ~/Desktop/CinderProjects/Cinder/xcode
./fullbuild.sh
With this step complete you should have a working build environment for this
project. All that remains is to clone this repo into
~/Desktop/CinderProjects
.
cd ~/Desktop/CinderProjects
git clone git://github.com/jimmyharris/ScatterTheWorld
- Open the project
ScatterTheWorld/xcode/ScatterTheWorld.xcodeproj
in Xcode. - Make sure the target is set to
Release
- Plug in your kinect.
- Hit Build & Run
Gestures:
- Wave to initialte hand tracking. If any existing particles are in the system they are cleared.
While Tracking:
-
Push to toggle particle creation on/off.
-
Move the hand to spread particles out over the screen.
-
Wave to leave the seesion.
Keyboard Controlls:
-
1
Toggle display Visible Light map (grayscale camera). -
2
Toggle Rendering of Particles. -
g
Toggle Gravitational pull towards the center of the window. -
p
Toggle Perlin Noise effect on particles. -
s
Begin recording frames to a movie to the desktop. The file will be namedTestMovie.mov
. Pressings
again will stop it.