here is how the first try looks:
you can see the zombie will hide behind the stove when you move and will move out of the it when it move forward. and i add a simple hit and die behavior for it.
the way to do this is simple.
first make sure you get the latest sdk of tango. for example, i tried to do this occlusion of real world object on game object, then i realized it has just implemented in tango sdk recently, so i update and it works! of course it is not that beautiful, there are jitters and holes on the wall but it works 🙂
secondly, open experimentalAugmentedReality scene in the sample. run it and you will see the google mark place on the place you point. there are two things you have to change to make it your game. first is the AugmentedReality script on GUIController, especially the prefabLocation, thats the object you place. also you can change how you want it work in the code. on the end of that code script, especially in “else if (Physics.Raycast(cam.ScreenPointToRay(t.position), out hitInfo))” is what you need to deal with when it hit something you created in your game world, and whats in the next else is what you want to do when it hit the depth clouds. another thing you have to change is the prefab Location Marker and its script,ARLocationMarker. I downloaded a zombie model and created a new ARLocationCharacter, so the zombie can move and animate and die.
one more thing important is, if you want to include the occlude as i showed in the video, that the zombie will hide behind real world object, you need to check the variable called EnableOcclusion on TangoPointCloud. it looks not perfect but it works especially around the corner. but if you try to see it works with something that is thin or black or reflect…. just dont count on it.
other things i did is add some effect on camera, like vigenette and color correction. i’m not good at this things so still do experiment. also add ui so you can put zombie and coffin, or shoot.
what i want to do next is combine this with ExperimentalMeshbuilder, so the depth cloud will be saved and it wont jitter so much and will fill holes automatically. another thing i want to do, but not sure if i can do, is to read the 3d info from the clouds, so i can “see” there is a cube, or there is a cluster of points which are supposed to be one object. if i can do this, i can fill holes automatically even for those that cant be detect, like if you put a glass bottle here. also if i can know there is a huge cube, i can use it to replace my millions of small cubes and smooth the surface and wipe out the noise.