Building for iOS with ARKit

Although we made this project for Microsoft HoloLens devices, that certainly is not a requirement. In this section, we will adapt the project for mobile devices using the Apple ARKit.

As we now know, the HoloLens device includes a depth sensing camera that estimates the distance of each pixel in view and stitches together a mesh, or spatial map, of the environment. Similar technologies are also available in Google Tango and Intel RealSense. New smartphones are emerging with these sensors built in, and that will make it easier to implement projects such as this using mobile phone devices rather than the expensive HoloLens HMD.

Apple introduced ARKit for iOS 11 to solve this problem without the need for special depth-sensing hardware in the mobile device. It uses regular camera and AI software to scan the environment and infer depth information based on parallax and other spatial cues, and then track the device's movement using its built-in motion sensors.

For iOS devices that support Apple ARKit, you can build the app using the Unity ARKit plugin, available on the Asset Store. Like the HoloLens, ARKit scans the room and provides a spatial map we can use to detect surfaces in the environment. Unlike HoloLens, which uses gaze-based input for UI and spatial positioning, we can use standard Unity screen touch events.

If you have been following along and have already built the HoloLens version of the project, we strongly suggest you save your work and copy the entire project directory tree for the ARKit version. There are incompatibilities between the SDK, and we're going to strip out HoloLens-specific components in this process.

Create a full backup of your HoloLens version of this project before beginning this ARKit version.

If you are starting from scratch, begin a new project with ARKit and then jump back to the beginning of this chapter to implement all the objects and components, substituting the changes that we will shortly describe. But for expediency, this section will assume that the DefaultPicture is already built and saved as a prefab.

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

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