How does it work?

Before we get too far ahead of ourselves, let's break open the HoloKit project and take a look at how or what it does. Open up the Unity editor and complete the following:

  1. Find the HoloKitCameraRig in the Hierarchy window, and then select and expand it. Expand the children's children and so on until you can see the Left Eye and Right Eye objects, as shown in the following screenshot:
View of the scene's 3 cameras in the Hierarchy window
  1. The VideoSeeThroughCamera is the main camera used when the app is in AR mode. When the app is in MR mode, the Left Eye and Right Eye cameras are used to create the stereo 3D vision. Take a closer look at the Eye cameras, and you will note that their position is slightly adjusted on the x axis. For the right camera, the amount is 0.032, and for the left it is -0.032. This is how we generate 3D stereo projections, using an offset camera for each eye.
  1. The other components are as follows:
    • HoloKitAmbientLight: It is just a standard directional light with the ARCore Environmental Light script attached.
    • HoloKitPlaneGenerator: It is a base object for the HelloARController script, which we have seen plenty of before.
    • HoloKitPlacementRoot: It is our main anchor point for the scene's virtual objects.
    • HoloKitCameraRig: It is what controls the app view.
    • HoloKitGazeManager: It is new and allows the user to select objects just by positioning their gaze or view on the target. You can try this now with the current scene and the ball. Fix your gaze on the ball and see what happens.
    • HoloKitPointCloud: It serves the same function as its counterpart in ARCore.
  1. Go through and continue to expand and inspect the rest of the objects in the scene.
  1. Connect, build, and run the scene again. This time, pay attention to the details and see if you can get the Gaze to work.

Well, hopefully that was relatively painless. Now, with HoloKit setup, we have the framework in place for our combined AR and MR app. We should expand on what our tech demo will do. The premise of our tech demo will be an app that allows the user to move between a traditional map interface and an AR or MR interface. The name HoloCore is a play on the ability to allow a user to drill into a map and render a 3D view in AR or MR. This also nicely ties in with the name ARCore. In the next section, we will look at adding a 3D map of the world to our app.

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

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