Summary
In this chapter, we examined the core structure of an augmented reality scene using AR Foundation. We started with the AR Foundation Samples project from Unity, building it to run on your device, and then exported its assets into an asset package for reuse. Then, we imported these sample assets into our own project, took a closer look at the SimpleAR
scene, and built that to run on your device.
Then, starting from a new empty scene, we built our own basic AR demo from scratch that lets the user place a virtual 3D object in the physical world environment. For this, we added AR Session and AR Session Origin game objects and added components for tracking and visualizing planes and point clouds. Next, we added user interaction, first by creating an Input Action controller that responds to screen touches, and then by writing a C# script to receive the OnPlaceObject
action message. This function performs a raycast from the screen touch position to find a pose point on a trackable...