Control characters in Unity with the Microsoft Kinect using the Zigfu samples

The Microsoft Kinect human motion controller offers an exciting way for players to interact with games and control their game characters. Some of the original developers of the software used in the Kinect started a company called Zigfu, and they now offer a Unity-Kinect development kit. This is a straightforward way to make Unity games that can use the Microsoft Kinect motion controller.

At the time of writing, an unlimited time free trial is available to download. The Zigfu free trial is like Unity free since it can be used for non-commercial projects and includes a watermark in projects.

Note

Be patient!

When you run a Kinect-device application, you will have to wait for 10-20 seconds for your computer to establish a link with the Kinect, and for the Kinect to detect a person standing in front of the camera. Learn more about the Microsoft Kinect at www.xbox.com/KINECT.

Getting ready

Go to the Zigfu website's downloads sections, and locate the Unity ZDK package (Zigfu Development Kit). At the time of writing, the ZDK Unity package is named ZDK_Unity35_.99f_trial.unitypackage, and can be found at http://zigfu.com/en/zdk/unity3d/.

How to do it...

  1. Create a new Unity project and import the ZDK package.
  2. You should now see two folders appear in your Project panel: Standard Assets and Zigfu.

    Note

    You can ignore any warning messages about inconsistent line endings.

  3. Open the AvatarFrontfacing scene, you'll find it in the SampleScenes folder inside the Zigfu folder. You should now see an avatar in the Scene and Game panels:
    How to do it...
  4. Plug in your Kinect camera, and ensure the Kinect power supply is connected and switched on.
  5. Run the scene.
  6. After taking a few seconds to open communication between the sensor and Unity, you should then be able to control the avatar through your own body movements.
    How to do it...
  7. You'll also see the "radar" display (top-right, white square), indicating the position of each user relative to the camera, and the raw point cloud display (bottom-right, yellow-black square).

How it works...

The sample scene contains a character, and also all the scripted Zigfu objects connected to this character, so that when the Zigfu objects receive movement event messages from the Kinect camera, these movements are passed on to move and rotate the appropriate parts of the visible character.

See also

  • The Animating your own characters with the Microsoft Kinect controller recipe.
  • The Homemade mocap by storing movements from the Microsoft Kinect controller recipe.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.157.6