官术网_书友最值得收藏!

Origin story

The center of your game world is called the origin. The origin is the magical place in 3D space where everything begins. 3D space is divided up by X, Y, and Z axes. If you remember your Cartesian grid from grade school, or if you've ever seen a bar or line graph, the X-axis runs one way (usually horizontally), and the Y-axis runs perpendicular to it (usually vertically). 3D is like taking a second piece of paper and sticking it at right angles to your graph so that you have a third axis firing straight up at your face from your desk, and down into the floor in the opposite direction.

The orientation (the way the X, Y, and Z axes are positioned) varies from program to program. Unity has a Y-up orientation. The X and Z axes run perpendicular to each other on the "floor". If you hold your arms out like a scarecrow, your arms are the X axis, and the Z axis runs through your belly button. The Y axis runs straight up into the sky, and straight down to the center of the Earth where there are probably goblins or some such creatures.

Let's get a better look at that ball. To orbit around the Scene view, hold down the Alt or Option key on your keyboard (depending on whether you're using a PC or a Mac) and press and hold the left mouse button. If the ball is centered near the origin, you should notice that the "ground" plane slices right through it. That's because the ball's transform ("registration" or "pivot point" in other software) is at its center. Half the ball is above ground, half the ball is below. If the ball's X, Y and Z position values are all zero, the center of the ball is at the origin, where the three 3D planes converge. It's entirely likely that your ball is floating around somewhere else in the Scene. Let's fix that right now.

Tip

Disoriented?

If you ever get lost orbiting, panning, and zooming around the Scene view, remember that you can reorient yourself by clicking on the gizmo at the top-right of the Scene view. Click on the green Y cone to view the scene from the top-down. Click the red X cone to view the scene from the right. Clicking on the blue Z cone focuses us at the front of the Scene. Click the gray box in the middle of the gizmo to return to a perspective view. If you want to completely reverse your view, you can click on the white cone sitting opposite to your orientation—doing this will flip the view around so that you're looking at things from the opposite angle. The label beneath the cone tells you which view you're currently using.

XYZ/RGB

If you've ever listened to your science or art teacher drone on about color spectrum of light, you might have noticed that X, Y, and Z map onto Red, Green, and Blue. Red, Green, and Blue are the primary colors of light, and are always listed in that order. If you're visually-oriented, it might help you to know that X is Red, Y is Green, and Z is Blue when you're looking at any depiction of axes in Unity. Most often, your selected axis turns yellow when you hover over or select it.

主站蜘蛛池模板: 威信县| 金阳县| 浦北县| 游戏| 宜兰市| 甘肃省| 陆良县| 绍兴县| 万荣县| 丹凤县| 常德市| 绩溪县| 乃东县| 来安县| 秭归县| 陈巴尔虎旗| 内丘县| 连平县| 兴安盟| 宜宾县| 淮南市| 昆明市| 喀喇沁旗| 普洱| 漳州市| 紫金县| 银川市| 恩平市| 县级市| 侯马市| 天台县| 娄底市| 开平市| 冷水江市| 富顺县| 孟津县| 张家界市| 西贡区| 延长县| 宣武区| 泽普县|