Unity说明文档翻译-Primitive and Placeholder Objects

Primitive and Placeholder Objects

原始对象和站位对象

Unity can work with 3D models of any shape that can be created with modelling software. However, there are also a number of primitive object types that can be created directly within Unity, namely the CubeSphereCapsuleCylinderPlane andQuad. These objects are often useful in their own right (a plane is commonly used as a flat ground surface, for example) but they also offer a quick way to create placeholders and prototypes for testing purposes. Any of the primitives can be added to the scene using the appropriate item on the GameObject > 3D Object menu.

Unity可以处理模型制作软件创建的任意形状的3D模型.当然,也有许多原始对象可以用Unity直接创建,即立方体,球体,胶囊体,圆柱体,平面和方框.这些对象在它们权限内是很有用的(例如,平面通常被用作平坦的地面),它们也是一个用来创建站位对象和测试原型的快捷方法.任何原始对象都可以使用菜单项GameObject->3D object来添加到场景内.

Cube

立方体

This is a simple cube with sides one unit long, textured so that the image is repeated on each of the six faces. As it stands, a cube isn’t really a very common object in most games but when scaled, it is very useful for walls, posts, boxes, steps and other similar items. It is also a handy placeholder object for programmers to use during development when a finished model is not yet available. For example, a car body can be crudely modelled using an elongated box of roughly the right dimensions. Although this is not suitable for the finished game, it is fine as a simple representative object for testing the car’s control code. Since a cube’s edges are one unit in length, you can check the proportions of a mesh imported into the scene by adding a cube close by and comparing the sizes.

这是一个简单的立方体有相同的边长和面,因此图片可以重复在6个面上.事实上,在大多数游戏里一个立方体并不是很常见,但当它鳞次栉比的出现时,很适合用作墙壁,亭岗,盒子,台阶和其他相似类型.当游戏模型还没准备好时,它也是程序员在开发过程中一个很好的站位对象.例如,一个车身可以初略的用一个大小相似的长方形盒子代替.尽管这不适合一个完成的游戏,但可作为一个用于汽车控制代码测试的简单替代对象.立方体的边长是单位1,你可以通过导入一个立方体到场景附近来检查网格大小比例.

 

Sphere

球体

This is a sphere of unit diameter (ie, 0.5 unit radius), textured so that the entire image wraps around once with the top and bottom “pinched” at the poles. Spheres are obviously useful for representing balls, planets and projectiles but a semi-transparent sphere can also make a nice GUI device for representing the radius of an effect.

这是一个单位半径球体(0.5单位半径),这样图片围着顶和底环绕一次,在两极收缩.球体显然用于表示球,行星和炮弹,但一个透明球体也可以用于表现一个GUI装置的影响半径.

Capsule

胶囊体

A capsule is a cylinder with hemispherical caps at the ends. The object is one unit in diameter and two units high (the body is one unit and the two caps are half a unit each). It is textured so that the image wraps around exactly once, pinched at each hemisphere’s apex. While there aren’t many real world objects with this shape, the capsule is a useful placeholder for prototyping. In particular, the physics of a rounded object are sometimes better than those of a box for certain tasks.

胶囊体是一个圆柱体加上两端的半球形帽子.此对象是一单位长度直径和两单位长度高(一单位长度身体加两个一单位长度直径帽子).它的贴图是环绕一次在两半球顶点收缩.虽然没有多少真实物体是这种形状的,胶囊体还是一个很有用的站位原型.特别是一个环形对象的物理学作用肯定比方形好.

Cylinder

圆柱体

This is a simple cylinder which is twounits high and one unit in diameter, textured so that the image wraps once around the tube shape of the body but also appears separately in the two flat, circular ends. Cylinders are very handy for creating posts, rods and wheels but you should note that the shape of the collider is actually a capsule (there is no primitive cylinder collider in Unity). You should create a mesh of the appropriate shape in a modelling program and attach a mesh collider if you need an accurate cylindrical collider for physics purposes.

这是一个简单的圆柱体,2个单位,直径一个单位,贴图是图片环绕管型身体但也分别显现在两个平面上,循环结束.圆柱体非常适合创建亭岗,棍子和轮子,但你得注意这个形状的碰撞检测是胶囊体(Unity里没有原始圆柱体的碰撞检测).如果你需要一个精确的圆柱体物理碰撞检测模型你需要用建模程序创建一个适当的网格形状并附着在碰撞检测网格上.

Plane

平面

This is a flat square with edges ten units long oriented in the XZ plane of the local coordinate space. It is textured so that the whole image appears exactly once within the square. A plane is useful for most kinds of flat surface, such as floors and walls. A surface is also needed sometimes for showing images or movies in GUI and special effects. Although a plane can be used for things like this, the simpler quad primitive is often a more natural fit to the task.

这是一个局部坐标上X,Z方向为10单位长度的平坦广场.贴图为整个图片一次性附着在广场上.平面多用于平面类型物体,如地板和墙壁.有时也用它在GUI上显示图片和电影以及特技效果.尽管平面可以用来做这些事情,但方框通常更适合这个任务.

Quad

方框

The quad primitive resembles the plane but its edges are only one unit long and the surface is oriented in the XY plane of the local coordinate space. Also, a quad is divided into just two triangles whereas the plane contains two hundred. A quad is useful in cases where a scene object must be used simply as a display screen for an image or movie. Simple GUI and information displays can be implemented with quads, as can particles, sprites and “impostor” images that substitute for solid objects viewed at a distance.

方框和平面非常相似,但它的边长为一个单位长度,并且它的面是在局部坐标的X,Y方向延伸的.另外,一个方框仅可分为两个三角形而一个平面包含两百个.方框在如下情况很有用:作为一个场景对象显示图片和电影.可以用方框作为简单的GUI,信息显示器,粒子,精灵和冒充图片以代替远景的立体对象.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值