- Unity Virtual Reality Projects
- Jonathan Linowes
- 386字
- 2021-06-25 21:58:23
Adding a plane
Now, let's add a ground plane object into the scene.
In the Hierarchy panel, click on the Create menu (or main GameObject menu) and choose 3D Object | Plane.
A default white plane is added to the scene, centered on the ground plane at Position (0, 0, 0). (If necessary, select Reset from the Inspector panel's Transform component's gear icon). Rename it to GroundPlane.
Note that 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 size of GroundPlane is 10 by 10 units and its transform's Scale is 1.
The cube is centered at Position (0, 0, 0), just like the ground plane. However, maybe it doesn't look like it to you. The Scene panel may show a Perspective projection that renders 3D scenes onto a 2D image. The Perspective distortion makes the cube not seem centered on the ground plane, but it is. Count the grid lines on either side of the cube. As you'll see, when it is viewed in VR and you're actually standing in the scene, it won't look distorted at all. This is shown in the following screenshot:
The cube is submerged in the ground 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 component's position is the world space location of the object's local origin. Let's move the cube as follows:
- Move the cube onto the surface of the ground plane—in the Inspector panel, set its Y position to 0.5: Position (0, 0.5, 0).
- Let's rotate the cube a bit around the y axis. Enter 20 into its Y rotation: Rotation (0, 0.5, 0).
Note the direction in which it rotates. 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 the coordinate system handedness. Some software uses left-handedness, others use right-handedness).
Unity uses a left-handed coordinate system. And the y axis is up.
- INSTANT Mock Testing with PowerMock
- 大話PLC(輕松動漫版)
- Oracle Exadata性能優化
- Python量化投資指南:基礎、數據與實戰
- Python入門很簡單
- 小程序開發原理與實戰
- Java編程技術與項目實戰(第2版)
- 實戰Java高并發程序設計(第2版)
- 30天學通C#項目案例開發
- Building Business Websites with Squarespace 7(Second Edition)
- Java程序設計教程
- 超簡單:Photoshop+JavaScript+Python智能修圖與圖像自動化處理
- Java語言程序設計實用教程(第2版)
- Microsoft Dynamics GP 2013 Cookbook
- 高質量程序設計指南:C++/C語言