Setting up a generic ARKit scene

To get started, we'll create a new Unity project, import the ARKit, and then import the SolarSystem package with the prefab that we exported previously. We are going to build the scene from scratch rather than modify one of the examples (as we did in the previous chapter). Then, we'll recreate a bit of the user interface we made previously. Follow these steps to do this:

  1. Create a new Unity 3D project, named SolarSystem-arkit.
  2. From Window | Asset Store, download and import the Apple ARKit package.
  3. Create a new scene (File | New Scene) and then save the scene as SolarSystem.
  4. Let's remove the ambient lighting in the scene:
    1. Open the lighting tab and go to Window | Lighting | Settings.
    2. Set Skybox Material to none (using the doughnut icon to the right of the parameter).
    3. Set Environment Lighting Source to Color.
    4. Set Lightmapping Settings Indirect Resolution to 1.

 

  1. Now we set up the camera with AR components and create ARCameraManager, as follows:
    1. In the Hierarchy root, create an empty object named CameraParent; reset its Transform if necessary (Transform | gear-icon | Reset).
    2. Drag Main Camera so it is a child of CameraParent, and reset its Transform too.
    3. With Main Camera selected, Add Component | Unity AR Video.
    4. For its Clear Material slot, click on the doughnut icon and select YUVMaterial.
    5. Add this component: Unity AR Camera Near Far.
    6. In the Hierarchy root, create an empty object named ARCameraManager.
    7. Add this component: Unity AR Camera Manager.
    8. Drag Main Camera onto its Camera slot.

That's it for the generic ARKit scene setup. Next, we can add our project objects.

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

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