Superdroidz / UnityRoomAlive

Unofficial RoomAlive Unity Intergration
18 stars 8 forks source link

How to use RoomAliveToolkitConsole's calibrated data? #1

Closed houzy closed 8 years ago

houzy commented 8 years ago

Above all, thanks for your contributions, I appreciate it. I have some questions about using calibrated data by RoomAliveToolkitConsole. I have cloned the RoomAliveToolkitConsole repository, and pulled its submodule RoomAliveToolkit. Firstly, I opened the visual studio project in the submodule folder, calibrated the kinect and projector, and get the calibrated data. Then, I opened the visual studio project in the RoomAliveWrapper folder, compiled it without any error, but when run it, I could just see a console window, I don't how to use this application. After that, I opened this UnityRoomAlive project by Unity3D, but how to import the calibrated data to the Unity3D project? Please give me some more information, thanks a lot.

louisch commented 8 years ago

We really should add documentation for this at some point, but basically, the whole thing is meant to be accessed via Unity.

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).

Superdroidz commented 8 years ago

Hi houzy,

Thanks for checking out our project, we appreciate all the feedback we can get. We are currently working on updating the readme with relevant instructions and an example for how to set up a Unity project with the use of one Kinect and one projector which will be posted soon.

louisch seems to have given you a brief overview of how to set up the scene using your existing calibration data but feel free to ask any further questions and we will be more than happy to help.

houzy commented 8 years ago

Great! It works now, thanks very much. @louisch