Adding a plane

Now let's add a ground plane object into the scene:

  1. Within the Hierarchy panel Create menu (or main GameObject menu), choose 3D Object | Plane.

A default white plane is added to the scene, resting centered on the ground plane at position (0, 0, 0) (if not, select Reset from the Inspector Transform gear icon).

At a scale of ( 1, 1, 1), Unity's plane object actually measures 10 by 10 units in X and Z. In other words, the plane's own size is 10 x 10 and its transform scale is 1.

The cube is centered at position (0, 0, 0), just like the plane. But maybe it doesn't look like it to you. The Scene panel may be showing a perspective projection that renders 3D scenes onto a 2D image. The perspective distortion makes the cube appear not to be centered on the plane, but it is. Count the grid lines on either side of the cube! But as we'll see, when viewed in AR, the perspective is the same as the video camera image (or actual optical see-through view); it won't look distorted at all:

The cube is submerged in the plane because its local origin is at its geometric center-it measures 1 by 1 by 1, and its middle point is (0.5, 0.5, 0.5). This might sound obvious, but it is possible for the origin of a model to not be its geometric center (such as one of its corners). The transform position is the world space location of the object's local origin:

  1. Move the cube onto the surface of the plane-in the Inspector panel; set its Y Position to 0.5: Position (0, 0.5, 0), as shown in the following screenshot:
  1. Now let's rotate the cube a little around the y axis. Enter 20 into its Y Rotation: Rotation (0, 20, 0).

Note the direction it rotates in. That's 20 degrees clockwise. Using your left hand, give a thumbs-up gesture-see the direction your fingers are pointing? Unity uses a left-handed coordinate system (there is no standard for coordinate system-handedness; some software uses left-handedness, while others use right-handedness, as illustrated in the following image):

By Primalshell - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=27531327
Unity uses a left-handed coordinate system-when the y axis is up and x is horizontal, then z positive is pointing away from you.

It is also worth noting the angle in which the cube is lit, its shading, and the direction of its shadow. This is determined by the directional light in the scene.

  1. Click on Directional Light in the Hierarchy, and in the Inspector under Transform, you can see its rotational orientation about the X, Y, and/or Z axes, in degrees.

We moved and rotated the cube numerically in the Inspector panel, but you can also change it by direct manipulation with your mouse in the Scene panel. Note in the preceding image that the active gizmo is for positioning, using the three arrows for each the x, y, and z axis. To move the object, click the tip of one of the arrows, which will constrain movement along that axis.

The transform gizmos that are available from the Unity docs are illustrated in the following screenshot, for (left to right) position, rotation, scale, and rect transform (rect transform is commonly used for positioning 2D elements, such as screen space UI elements). For more information, visit http://docs.unity3d.com/Manual/PositioningGameObjects.html.

A gizmo is a graphical control that lets you manipulate the parameters of an object or view. Gizmos have grab points or handles that you can click and drag with the mouse.