Superdroidz / UnityRoomAlive

Unofficial RoomAlive Unity Intergration
18 stars 8 forks source link

Unoffical RoomAlive Toolkit Unity Intergration README

This project intergrates the RoomAlive Toolkit created by Microsoft Research. It uses a modified version of the toolkit which can be found here which is required to work. It allows developers to calibrate, scan and import the room object file all within Unity.

This project is still in development and therefore this README will be updated with any changes that affect the use of the plugin.

Authors

This was a joint effort of the following team members :

Prerequisites

As mentioned in the RoomAlive Toolkit, the project uses SharpDX and Math.NET Numerics packages. These will be downloaded and installed automatically via NuGet when RoomAlive Toolkit is built.

The 'Shaders' project requires Visual C++. Note that in Visual Studio 2015, Visual C++ is not installed by default. You may be prompted to install the necessary components when building the 'Shaders' project of the RoomAlive Toolkit.

Installation and Setup

Build RoomAlive Toolkit

Before proceeding with Unity, the Toolkit needs to be built. This can be done by opening up the the project solution in Visual Studios and building the project.

Easy The Unity Intergration can be easily be imported via the included Unity Package file.

Simply import the package via the Assets/Import Package/Custom Package menu item.

Note: Importing via this method will overwrite any files that share the same name and are in the same position in the file structure.

Manual Simply clone or download the zip folder of the project. You are then free to place the files as you wish into your Unity Project.

Note: All files for this intergration must remain under the Editor folder, this is a requirement of Unity.

Quick Overview Tutorial First, you need to build the RoomAliveWrapper and all the existing RoomAlive Toolkit files, which you've probably already done if you ran it.

Next, inside Unity once you've imported the Assets folder into your project, there should be a menu in the menu-bar titled RoomAlive.

You need to access RoomAlive -> Settings. Then, the three paths need to be set to executables that are built during the first step.The first two should be RoomAliveToolkit's Projector and Kinect servers, which should have been built and placed in some subfolder called RoomAliveToolkit/ProCamCalibration/bin/... inside the RoomAliveWrapper project. The third is a wrapping program that also resides in the RoomAliveWrapper project, which has a path like RoomAliveWrapper/bin/Debug/RoomAliveWrapper.exe. You can use the Browse button here to access them if you wish.

After that is set up, you can start the Projector and Kinect servers with the first two buttons in the RoomAlive menu. It does not matter whether you start them by hand, it's just that we intended that the process be as integrated into Unity as possible. There is also a button to stop the servers if that is required.

Then, you need to use RoomAlive -> Create New Setup, which sets a working directory which the plugin will use to write a calibration to. Alternatively, you may want to use RoomAlive -> Load Existing Setup instead if you already have a calibration xml (it pops up an explorer dialog to locate an xml file).

The remaining four buttons are

In your case, if you have loaded existing setup, then you just need to click the last three buttons in order, and it should instantiate a few prefabs which take care of everything.

Note that with our plugin, we modify the main camera's view frustum automatically to fit the calibrated projector.

If Enable head tracking is enabled in the settings, then Instantiate Prefabs will also create a secondary Camera/Projector object called HeadTracker which will render its view onto objects in the Room layer, including the imported OBJ file, if it is in scene (I can't remember whether Import Room instantiates the OBJ file, but if it doesn't, then just drag it into the scene).