Hanging a virtual photo on your wall
For this project, the app scans the environment for vertical planes. When the user wants to hang a picture on the wall, we'll show a UI panel that instructs the user to tap to place the object, using an animated graphic. Once the user taps the screen, the AddPicture mode instantiates a FramedPhoto prefab, so it appears to hang on the wall, upright and flush against the wall plane. Many of these steps are similar to what we did in Chapter 5, Using the AR User Framework, so I'll offer a little less explanation here. We'll start with a similar script and then enhance it.
Detecting vertical planes
Given the AR Session Origin already has an AR Plane Manager component (provided in the default ARFramework
template), use the following steps to set up the scene to scan for vertical planes (instead of horizontal ones):
- In the Hierarchy window, select the AR Session Origin object.
- In its Inspector window, set the AR Plane Manager...