Building and running using Apple ARKit

Presently, ARKit does not support image target recognition to trigger augmented graphics the way Vuforia does. Rather, ARKit is great at anchoring objects to 3D locations in space. So that would really be off topic from the theme of the chapter, which is specifically to recognize and augment a business card. Still, it may be fun to try our drone model using the Apple ARKit if you have a compatible device.

The simplest approach is to start a new Unity project, import the ARKit package, and add the drone to the UnityARKitScene scene. Please refer to the ARKit topic in Chapter 3, Building Your App for additional details. Take the following steps:

  1. On your Mac, create a new Unity project, named DroneDemo.
  2. From Window | Asset Store, Download and Import the Apple ARKit package.
  3. Open the scene UnityARKitScene via File | Open Scene.
  4. In the scene Hierarchy, Create Empty game object child of HitCubeParent named Flying Drone.

 

  1. Add Component named UnityARHitTestExample to FlyingDrone, and drag HitCubeParent onto its Hit Transform slot.
  2. Disable the HitCube object to hide it.
  3. Import the SimpleDrone package using Assets | Import Package | Custom Package.
  4. Drag the SimpleDrone prefab into the Hierarchy, and make it a child of FlyingDrone.
  5. Assuming you also want the drone to fly around, follow the instructions earlier in the chapter for Animating the Drone.

The resulting Hierarchy looks like this:

Now just Build and Run this scene, and then build it from Xcode to enjoy your augmented drone. The following is a screen capture of our drone flying around my kitchen:

Building for Google ARCore
Please refer to the GitHub repository for this book for the implementation notes and code using Google ARCore for Android: https://github.com/ARUnityBook/. The principles are very similar to ARKit but the Unity SDK and components are different.
..................Content has been hidden....................

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