A framework for building interactive art.
Pics are good but videos are better.
Here's the fastest way to get set up:
./start.sh
By default, Kimotion plays a recording, so you don't need a Kinect or Leap to have fun.
This needs to be added to the README. Until then, please see Kimotion Modding 101.
In order to run Kimotion with live data from a Kinect, a few more things need to be installed:
Node.js and npm: Fedora: yum install nodejs npm
, Ubuntu: apt-get install nodejs npm
NumPy: Fedora: yum install numpy
, Ubuntu: apt-get install python-numpy
libfreenect (with python bindings), which you'll need in order
to hook up a real Kinect via USB. On Fedora, yum install libfreenect libfreenect-python
, on Ubuntu: apt-get install freenect python-freenect
.
Once those are installed, launch the websocket server:
cd server
python server.py
Then open Kimotion (see quick-start), choose a mod that uses the Kinect, like 'sandstorm'. Voila!
To install the Leap Motion on Fedora, follow these steps:
Q. How can I install on Fedora?
A. For Fedora 21 and later, first install alien and convert Leap-*-x64.deb
into a rpm package as follows.
sudo yum update
sudo yum install alien
sudo alien -rv --scripts Leap-*-x64.deb
Next, run:
sudo rpm -ivh --nodeps --force leap-*-2-x86_64.rpm
Q. How do I uninstall on Fedora?
A. Run:
rpm -ev leap-*-2-x86_64.rpm
This needs to be added to the README. Until then, please see Kimotion Modding 101.
In the constructor of your mod, you may choose which mode to use, 2D or 3D.
2D mode uses the excellent p5js library. This mode is easier to get started with, so I recommend using it first.
To enable 2D mode, place this in your mod's constructor:
this.set_graphics('2d');
3D mode uses the equally excellent threejs library. It's larger than p5, and has a steeper learning curve, but if you'd like to use some 3D effects, go for it! Some of the existing mods use threejs, so peek at them for some examples.
To enable 3D mode, place this in your mod's constructor:
this.set_graphics('3d');
Follow these steps to create a recording:
You should now have a file named something like
leap-playback-recording-110fps.json.lz
. Now let's copy that recording into Kimotion.
leap-playback-recording-110fps.json.lz
file into your mod's
directory. For example, src/mods/mymod/
.recording.json.lz
.main.js
file, find the set_input
call and add the path
to your recording.For example:
// before
this.set_input('leap');
// after!
this.set_input('leap', 'mods/example2d/recording.json.lz');
Your mod now has its own recording! Refresh your mod to see it. Make sure the "Use recording?" box is checked!
If you'd like to use a Kinect recording, I highly recommend installing the
http-server
package from npm.
npm install -g http-server
Now, when you run Kimotion's ./start.sh
, it will launch http-server instead,
with gzip enabled. Kinect recordings are huge and otherwise take a long time
to download, even from localhost.
The default recording will play if you have Use recording? checked, but you
can choose from other recordings as well. In your mod's
constructor, pass the recording file you wish to use into set_input
.
this.set_input('kinect', 'recordings/kinect/handtracking.bin');
(Note: the recordings are all gzipped. If you don't install http-server, you'll need to extract them before using a recording.)