In this tutorial, I am going to help you get started with Vitruvius and Unity3D, step by step.
- Kinect for XBOX v2 sensor with an adapter (or Kinect for Windows v2 sensor)
- Kinect for Windows v2 SDK
- Unity3D 5.0 or higher
- Visual Studio 2013 or higher
- Windows 8.1 or higher
- A dedicated USB 3 port
The following binaries are included:
This is the most important file. Contains all of the magic sauce of Vitruvius.
Since Microsoft does not have an “official” Unity-compatible dll, we created for you. This dll should be always included in your projects.
In case you are already using the old Microsoft’s Unity package, you’ll need to delete the StandardAssets code and keep Windows.Kinect.dll.
Now, let’s create our first Kinect project using Unity and Vitruvius.
Step 0 – Download Unity & Visual Studio
I recommend using the latest version of Unity, even though any version higher than 5.0 would do the job just fine. Unity is a powerful game engine based on DirectX. It gives you the ability to create amazing 3D and 2D applications easily, with performance in mind. Visual Studio is a state-of-the-art Integrated Development Environment that helps you build, debug, and deploy your apps.
Step 1 – Download Vitruvius
Unity binaries and samples are included in the Academic, Premium, and Platinum versions of Vitruvius. So, download the version of your choice and unzip the folder. The folder is named LightBuzz.Vitruvius.x.x.x.
The following files and folders are included:
Contains the .dll files for the supported platforms.
Contains MSDN-like documentation files.
Contains a dozen demo projects to get started.
Includes the recent version changes and updates.
A dull, boring, legal agreement. In short: you can use the products you create with Vitruvius as you like. Just don’t re-sell the binaries.
Some basic information about the hardware and software requirements.
A personal message from Vangos Pterneas (Microsoft Kinect MVP) to you.
Step 2 – Open the Unity Package
We’ll get started immediately! Let’s open the one of the demos. Vitruvius comes with a handy .unitypackage file. If you are already familiar with Unity, you know that a .unitypackage is a set of code, assets, and dll files that can be integrated into your own projects. To open the .unitypackage file, navigate to the folder:
LightBuzz.Vitruvius.x.x.x ⇒ Samples ⇒ LightBuzz.Vitruvius.Samples.Unity
Double-click the .unitypackage and Unity Engine will launch automatically.
Step 3 – Create a new Project
When Unity launches, you have to either create a new project or choose an existing one. Vitruvius binaries will be installed automatically.
Let’s create a new project. Specify a name and a location for your project. Click “Create Project”.
Wait a few seconds while Unity is importing the packages. When finished, you should see a blank screen with all of the imported data.
Step 4 – Open a Sample Demo Scene
To reveal the sample demos, open the following folder:
Assets ⇒ LightBuzz.Vitruvius ⇒ Scenes
The following scenes are available:
Displays angles between some specified human body joints, along with visual arcs.
Animates five 3D body models based on the movements of the human body.
Avateering Color Sample
Animates a 3D model on top of the Color stream.
Shows how easy it is to acquire High Definition Face points (eyes, nose, forehead, mouth, chin, jaw, chins, cheeks).
Fitting Room Sample
This is a virtual mirror (fitting room) demo with three clothes. Women will love it!
Frame Effect Sample
Shows the streams of every camera (Color, Depth, Infrared) and a stickman.
Demonstrates some common Kinect gestures (wave, swipe, zoom, start).
Green Screen Sample
The classic background removal application.
Green Screen Fitting Room Sample
This is a combination of the background removal demo and the fitting room demo: the app detects the body, removes the background, and puts on some clothes.
Using this sample, you can record & playback the Color, Depth, Infrared, Body, and Face streams.
Selective Angle Sample
Shows you how to move only specific parts of a 3D avatar.
To open a scene, double-click the corresponding file. For example, I’m opening the AvateeringSample.
To edit the source code of each scene, navigate to the folder:
Assets ⇒ LightBuzz.Vitruvius ⇒ Scripts
The Scripts folder contains the code-behind C# files that are used to control the game objects and give interactivity to the apps.
Step 5 – Play!
To test a scene, click the Play button.
And… that’s it! You just saw how easy it is to get started with Kinect using Unity3D and Vitruvius.
So, go on! Modify the samples to create your own amazing apps. What are you planning to develop?
Till the next time… keep Kinecting!