Placing our bin

Unlike Virtual Reality, where the experience is independent of your physical space, MR is concerned mainly with enhancing it; therefore holograms, to be effective, need to look, act, and behave like real objects. This involves precisely positioning and orienting holograms to places in the world that are meaningful to the user.

In this section, you will learn one approach for placing holograms in the real world, allowing the user to manually place the hologram onto a horizontal surface. In the next chapter, we will further explore placement by looking at another approach that tries to automatically place the hologram in the environment based on a set of specified constraints. Let's first start by discussing what we are trying achieve and a high-level description of the approach we will take.

Our goal is to simply place the bin somewhere on the floor that is appropriate for the user to throw paper into it. In this context, we define appropriate to mean placing the bin between a minimum and maximum distance from the user and somewhere the user has a clear line of sight, avoiding positions where the user and bin are obstructed by any surface.

We will have the user manually place the bin with our assistance; during placement, the bin will follow the user's gaze and, when in a valid position, allow the user to place the bin using the tap gesture. We consider a valid position to be one where there is an approximately flat surface underneath and the area is large enough for the bin to be placed onto.

Let's begin by first updating the Layer assigned to the Bin and applying the change to its prefab; we do this to have a convenient way of recognizing the bin when the user is gazing at it. Select the Bin from the project's Hierarchy panel in the Inspector locate the Layer dropdown and select the layer we created called Hologram. Select Yes when asked to apply to children. Now, click on the Apply button to apply those changes to the prefab. Finally, delete the bin from the scene by right-clicking on the Bin and selecting Delete.

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

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