Using 3D models with ARKit
In the previous recipe, we looked at how to detect horizontal planes in the environment, and how to place a 3D object in the AR world. In this recipe, we are going to build on our existing knowledge and use a more realistic object that we might find in the real world – something that is more fun and recognizable. This is where AR really starts to come to life.
Getting ready
While this recipe builds on top of the previous recipe, it is recommended in this recipe that we create a new Xcode project. This is because Xcode provides us with a more efficient way of setting up an AR app that will look just like our previous recipe.
How to do it…
Let’s get started with the new recipe:
- Create a new project in Xcode. Go to File | New | Project | Augmented Reality App. For this app, be sure to choose SwiftUI for Interface and RealityKit for Content Technology:
Figure 11.5 – Selecting Augmented...