Setting up HoloKit

The great thing about HoloKit is that it comes complete with its own Unity template project. This makes our job of getting up and running with HoloKit quite painless. Open up Command Prompt or a shell window and do the following:

  1. If you haven't already done so, create a new folder from the root called ARCore and navigate to it:
mkdir ARCore
cd ARCore
  1. Clone the HoloKit repository into it:
git clone -b android https://github.com/holokit/holokitsdk.git
  1. That command clones the specific Android branch, which we will use. HoloKit is also supported for ARKit on iOS.
  2. Open a new instance of the Unity editor. Create and open a new project called HoloCore in the ARCore folder.
  3. In the Project window, create a new folder under Assets called HoloCore. Under that new folder, create our standard five new folders (Scripts, Scenes, Materials, Models, and Prefabs).
  4. Open the ARCore/holokitsdk/Assets folder with a file explorer window. Make a copy of the HoloKitSDK folder and place it in the ARCore/HoloCore/Assets folder. When you are done, return to the editor, and you should see the assets getting imported and compiled. After the import is complete, confirm that your Project window resembles the following:
Project window folders showing HoloKitSDK
  1. If you are prompted to switch to Android, elect to do so by clicking on OK.
  2. From the menu, select Edit | Project Settings | Player. This will open the Player (as in app player) settings panel. Select the Android tab and uncheck the Multithreaded Rendering option, and set the Package name, API Levels, and ARCore Supported, as shown:
Setting the Player settings for Android
  1. Open up the HoloKit sample scene CubeOnTheFloor in the Assets/HoloKitSDK/Examples folder.
  2. From the menu, select File | Save Scene as, and save the scene as Main in the Assets/HoloCore/Scenes folder.
  3. Open up Build Settings and add the current scene to the build.
  4. Connect, build, and run. You should see a rather small button in the top corner with the letter C. Press that button to switch from AR to the MR mode. When you are ready, put your device into the HoloKit headset and enjoy your first MR app.

Unlike Google Cardboard, HoloKit needs to let the camera view the user's surroundings in order to track. As such, you may need to modify the headset by cutting out a larger hole for the device's camera to see through. Here's a pic of a HoloKit that needed to be modified in order to accommodate a Samsung Galaxy S8:




Modified HoloKit to allow camera to visibly track

If you have another device that you want to hack, like Cardboard, then just ensure that you cut a space so that the camera is not blocked. Some other mixed reality headsets that work with mobile devices already have camera extensions. These camera extensions may support a fish eye lens, which allows for the device to see a wider area. This works quite well, since it essentially converts the camera into a sensor with a wide angle lens.

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

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