Search code examples
unity-game-enginegoogle-project-tango

Tango Predefined Objects


I'm somewhat familiar with tango and unity. I have worked through the examples and can get them to work correctly. I have seen some people doing an AR type example where they have their custom objects in an area to interact with or another example would be directions where you follow a line to a destination.

The one thing I cannot figure out is how to precisely place a 3d object into a scene. How are people getting that data to place it within unity in the correct location? I ha e an area set up and the AR demo seems promising but I'm not placing objects with the click of a finger. What I am looking to do is when they walk by my 3d object will already be there and they can interact with it. Any ideas? I feel like I've been searching everywhere with little luck to an answer to this question.


Solution

  • In my project, I have a specific space the user will always be in - so I place things in the (single room) scene when I compile.

    • I Create an ADF using the provided apps, and then my app has a mode where it does the 3D Reconstruction and saves off the mesh.
    • I then load the Mesh into my Unity Scene (I have to rotate it by 180° in the Y axis because of how I am saving the .obj files)
    • You now have a guide letting you place objects exactly where you want them, and a nice environment to build up your scene.
    • I disable the mesh before I build. When tango localises, your unity stuff matches up with the tango world space.

    If you want to place objects programatically, you can place them in scripts using Instantiate I also sometimes have my app place markers with a touch, like in the examples, and record the positions to a file, which I then use to place objects specifically... But having a good mesh loaded into your scene is really the nicest way i've found.