LZ-Says: Hey, time, time, slow down~
foreword
Today, let's learn about the coordinate system in Unity.
First of all, we need to be clear that in Unity, there are two types of coordinate systems:
world coordinate system;
local coordinate system
Below, an explanation is given based on these two coordinate systems.
1. The world coordinate system
The world coordinate system, which is based on our current game scene. Let's first observe the coordinates of a game object:
corresponding respectively. X, Y and Z axes.
Of course, the most direct way is to click on the upper right corner of the Scene view window to observe the X, Y and Z axes:
Observe the values corresponding to the X, Y and Z axes of the property view window on the right:
So where is the origin of the world coordinate system? Let's quickly locate the center point:
Therefore, the world coordinate system is simply summarized as:
Based on the center point of the game scene, the coordinates of the X, Y, and Z axes of the game model.
2. Local coordinate system
The local coordinate system depends on the parent model. Of course, there is a parent and a child, and the relationship between the two is similar to that of the parent container and child controls in our Android.
The following is a simple model of a cube containing a sphere:
Let's first look at the coordinates of the cube:
Then observe the coordinates of the sphere:
It can be seen intuitively that the sphere is just at the center of the cube, that is, at the origin coordinate point of the center of the cube.
Next, we drag the cube and sphere respectively to observe the transformation of their coordinate points:
end
Over time, the rivers merge into rivers, and the sea contains hundreds of rivers~