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

The default world space

A default empty Unity scene consists of a Main Camera object and a single Directional Light object, as listed in the Hierarchy panel and depicted in the Scene panel. The Scene panel also shows a perspective of an infinite reference ground plane grid, like a piece of graph paper with nothing on it yet. The grid spans across the x (red) and z (blue) axes. The axis (green) is up.

An easy way to remember the Gizmo axes colors is by keeping in mind that R-G-B corresponds to X-Y-Z.

The Inspector panel shows the details of the currently selected item. Select the Directional Light with your mouse, either from the Hierarchy list or within the scene itself, and look at the Inspector panel for each of the properties and components associated with the object, including its transform. An object's transform specifies its position, rotation, and scale in the 3D world space. For example, position (0, 3, 0) is 3 units above (in the Y direction) the center of the ground plane (X = 0, Z = 0). A rotation of (50, 330, 0) means that it's rotated 50 degrees around the axis and 330 degrees around the axis. As you'll see, you can change an object's transforms numerically here or directly with the mouse in the Scene panel.

Similarly, if you click on the Main Camera, it may be located at the (0, 1, -10) position with no rotation. That is, it's pointed straight ahead, towards the positive Z direction.

When you select the Main Camera, as shown in the preceding editor screenshot, a Camera Preview inset is added to the Scene panel, which shows the view that the camera presently sees. (If the Game tab is open, you'll see the same view there too). Presently, the view is empty and the reference grid does not get rendered, but a foggy horizon is discernible, with the grey ground plane below and the blue default ambient Skybox above.