Kinect Basketball Game

Kinect driven basketball game created using the Cinder creative coding framework. Although the project is not anything special compared to commercial games, we had to address a couple of technical difficulties.

First we built the 3d model loader based on the Open Asset Import Library. All 3d objects were modelled and rigged in Blender, then loaded with Cinder-Assimp. The texture of the scoreboard and the advertisement stripe were switched to Fbo textures. The meshes were added to the physical simulation based on Cinder-Bullet. The nodes of the player’s model were controlled by orientation data acquired from a kinect sensor.

For the ball throwing we developed a throw detection algorithm, which takes arm strength, position and speed into account. At the ball release point we measured the velocity vector of the basketball, and compared it with ideal velocity grid points which surround the user. Below a certain threshold the ideal velocity was used and the ball was thrown into the basket. The biggest the velocity deviation was from the ideal the closest the shot would be to the actual throw.

While adding sound effects we have found the default cinder audio a bit unreliable on windows, although it works very smoothly on osx. Because of this, we had to quickly put together a very rudimentary OpenAL based sample playback system, which is available at https://github.com/gaborpapp/Cinder-OpenAL

Credits

Botond Gábor Barna, Gáspár Hajdu, Bence Samu, Gábor Papp