Object Surface Observer

Finally, we have the Object Surface Observer. This is simply a solution to allow Unity users to have a spatial map that they can use inside the editor.

The Game Object that is a mesh of the space you want to test in is called the Room Model.

Let's take a quick minute to go ahead and put the spatial map that we imported earlier into the Object Surface Observer:

  1. Click on the root Prefabs folder.
  2. Click and drag the Spatial Mapping model to the Room Model field, as follows:
  1. Now, drop it as shown here:

Now, if you click on the play button to test out our application, you should see this spatial map mesh. If you are wondering, yes this is my apartment. You can use the mouse along with the W, A, S, and D keys to move around and see the mesh.

You could also build, compile, and deploy this app to your HoloLens now to see your spatial map. The Spatial Mapping Manager handles the spatial map to be used based on the device that is running it.

It should be noted that the mesh is rather ugly at the moment. Mesh processing, such as gap closing, mesh smoothing, or even adding fancy shaders, is an option, but can be an expensive option for the HoloLens processors. As a result, it is not handled automatically. Also, since we do not need a pretty spatial map for our project, we will not address it in this book.

Now that we have the spatial map in and working, it is time to move on to creating our application manager and learning a little about design patterns.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.238.76