These instructions will get you up and running with a simple point cloud application in Unity, intended for Unity developers of any experience level. You'll build a simple scene in Unity, import the Tango functionality, and attach prefabs that get the depth sensor data and display it as you move the Tango device around.
If you haven't set up your computer to develop with Tango in Unity yet, see Getting Started With Unity.
Go to the Setup for All Unity Tango Apps page and perform the basic setup operations on that page. When you have finished, return to this page and continue on with the steps below.
Add prefabs to your Hierarchy
You'll need the Tango Point Cloud and Tango Camera prefabs.
If you're not familiar with Prefabs, see the Unity documentation on them.
- In the Project panel, click TangoPrefabs to view the contents of that folder.
- Drag the Tango Point Cloud prefab (rainbow box icon) into the Hierarchy panel.
- Drag the Tango Camera prefab into the Hierarchy panel.
Enable depth in the Tango Manager
- In the Hierarchy panel, select the Tango Manager prefab.
In the Inspector, select Enable Depth in the Tango Application (Script) component.
Enable mesh rendering to update the point cloud
- In the Hierarchy panel, select the Tango Point Cloud prefab.
- In the Inspector, select the checkbox to the left of Mesh Renderer.
In the Tango Point Cloud (Script) component, select Update Points Mesh.
Build and run your project
- On the File menu, click Build and Run.
- In the Build Settings dialog, click Build and Run.
- In the Build Android dialog, enter a name in the Save As field, and then click Save.
After the build bar clears, Unity launches your application on the Project Tango device. Walk around with your device, and see it render the Point Cloud of what it sees!