Building a test scene

As always, let's take a look at how this looks in our tools. Open up Unity with the sample ARCore project we have already installed, and perform the following steps:

  1. From the menu, select File | New Scene. This will create a new empty scene for us in Unity.
  2. From the Project window, drag the Andy prefab from the Assets/GoogleARCore/HelloARExample/Prefabs folder into the Hierarchy window, as shown in the following screen excerpt:
Unity interface showing Andy prefab dragged onto the scene
  1. Andy is quite small, so we will adjust his size and the camera so that he fits in the Scene and Game windows better. Select Andy and modify Transform Scale to as 25, as 25, and as 25. Then, select Main Camera and modify its Transform Position to as 4. This is shown in the following screen excerpt:
Setting the Transform of Andy and the Main Camera
  1. Click on the Game and Scene tabs to switch views and see how the Andy model looks in each view.
The Scene window in Unity is for composing your scene objects. This is where you will generally do most of your work in Unity. The Game window represents the view, as close as possible, as it is rendered in game. Unfortunately, for ARCore apps, we are limited to testing on a device and thus unable to generate an accurate game view. This is why, for now anyway, we will work in a separate scene for discovery purposes.
  1. From the menu, select GameObject | 3D Object | Plane. This will add a new plane to the scene. Ensure that the plane is positioned at 0,0,0 by clicking on the Gear icon beside the Transform component in the Inspector window and selecting Reset Position from the menu. After you do that, Andy will be casting a shadow on the plane.
  2. Switch between views again. Expand the Shaded dropdown just under the Scene tab, as shown in the following excerpt:
The Draw Mode menu
  1. This menu represents the various Draw Modes Unity can support. Some of these may make sense, such as Wireframe, while others less so. In any case, run through the list of each option to see what they do.
..................Content has been hidden....................

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