We've seen XBox's flat 2D based Kinect NUI, but that's like wasting a whole "D"! We don't live in a flat world, so neither should our NUI's. Today's project responds to that and shows off controlling and manipulating 3D objects in a Kinect world.
WPF 3D Manipulation with Kinect
I've created an implementation of a Kinect NUI Trackball which can be used for manipulating a camera around WPF 3D scenes. This "HandsTrackball" is adapted from the Trackball class included in the source code for WPF 3DTools. The original Trackball class allows you to use the mouse to rotate around a WPF 3D scene.
My HandsTrackball basically maps hand movements to what the original Trackball uses as mouse points. Some new ground rules as well as as some Kinect depth-to-screen point calculations are applied in order to make this all work.
The user's left or right hand can be used to rotate around the model. When the user moves their hand, a transform is applied to the camera viewing the 3D scene (the camera moves and the objects in the scene do not move). The camera only moves if the user's hands are at least a minimum distance away from the user's torso. The user can only move the camera when their hand is deliberately extended out from their body. This is a key constraint in order to make the HandsTrackball usable. It allows the user to put their hand(s) down to stop changing the camera angle and prevents accidental movement.
Project Information URL: http://kindohm.com/2011/07/05/WPF3DManipulationWithKinect.html
Project Download URL: http://kindohm.com/files/Kinect3dManipulation.zip
Project Source URL: http://kindohm.com/files/Kinect3dManipulation.zip