Unity Virtual Reality Projects
上QQ阅读APP看书,第一时间看更新

Adding a cube

Let's add the first object to the scene: a unit-sized cube.

Within the Hierarchy panel, use the Create menu and choose 3D Object | Cube. The same selection can also be found in the main menu bar's GameObject drop-down menu.

A default white cube is added to the scene, centered on the ground plane at the (0, 0, 0) position, with no rotation, and a scale of one, as you can see in the Inspector panel. This is the Reset setting, which can be found in the object's Transform component of the Inspector panel.

The Reset values of the Transform component are Position (0, 0, 0), Rotation (0, 0, 0), and Scale (1, 1, 1).

If for some reason your cube has other Transform values, set these in the Inspector panel or locate the small gear icon in the upper right-hand side of the Inspector panel's Transform component, click on it, and select Reset.

This cube has the dimensions of one unit on each side. As we'll see later, one unit in Unity corresponds to one meter in world coordinates. Its local center is the center of the cube.