查看: 2268|回复: 3
打印 上一主题 下一主题

[经验分享] 基本对象 Primitive Objects

[复制链接]

1557

主题

1

听众

1万

积分

资深设计师

Rank: 7Rank: 7Rank: 7

纳金币
454
精华
31

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

跳转到指定楼层
楼主
发表于 2013-10-16 16:13:06 |只看该作者 |倒序浏览

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 Cube, Sphere, Capsule, Cylinder, Plane and Quad. 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 > Create Othermenu.

Unity可以运行由建模软件创建的任意3D模型。然而,也有一些可以直接在Unity创建的基本的对象类型,如立方体 、 球体 、 胶囊 、 圆柱体 、 平面和四边形 。这些对象往往很有用(例如,plane是常用的是一个平坦的地面),但他们也提供了一个快速方法来创建占位符和原型用于测试目的。任何基本对象通过GameObject > Create Other菜单对应的项添加到场景。

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.

这是一个简单的一个单位大的立方体,贴图会使图像在六个面上重复。既然这样,当缩放时Cube在大多数游戏中不是一个很常用的对象,它常用于墙壁、柱、箱子、台阶以及其他类似的项目。在开发过程中尚未完成模型时,这也是一个方便的占位符对象供程序员使用。例如,可以使用一个大致正确的尺寸拉长的立方体粗略模拟车体。虽然不适合成品的游戏,这是作为一个简单代表对象来测试汽车的控制代码是很好的。由于Cube的边缘是一个单位长度,通过在附近创建个立方体来对比大小,你可以检查mesh导入到场景的比例。

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个单位),贴图使整个图像的顶部和底部的“夹持”在两极环绕一周。Spheres表示球、行星和炮弹显然是有用,但半透明的球体半径的效果,也可以做出漂亮的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.

capsule 是一个圆柱体并在两端带有半球形盖。该对象是一个单位直径和两个单位高(身体是一个单位和两个盖子每个是半个单位)。贴图使得图像夹在每个半球的顶点环绕一周。虽然现实世界有许多的物体的形状,胶囊是一种有用的占位符原型。特别是,一个圆角物体的物理有时比对某些任务盒子更好。

Cylinder 圆柱

This is a simple cylinder which is two units 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.

这是一个简单的圆柱体有两个单位高和一个单位直径,纹理是图像包围一周的桶状和两端的平面。圆柱创建邮桶、棒和车轮是非常方便的,但你应该注意到碰撞器的的形状实际上是一个胶囊(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.

这是一个在局部坐标空间XZ平面上边长10单位的平面正方形。它的纹理是整个图像显示在正方形内。平面是有用的,大多数种类的地板和墙壁以及平整的表面。有时还需要用在GUI和特殊效果显示图像或电影。虽然plane可以使用于像这样的事情,简单的quad往往是更适合的方法。

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.

quad类似于plane,但它的边长,只有一个单位取向局部坐标空间中的XY平面上。此外,quad仅有两个三角形,而plane包含200个。对于场景对象仅仅作为显示在屏幕上的图像或电影,quad是很有用的。使用quad可以实现简单的gui和信息显示,还有粒子、精灵和“替代物”来代替实体物体在远处观看的图像。


分享到: QQ好友和群QQ好友和群 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
转播转播0 分享淘帖0 收藏收藏0 支持支持0 反对反对0
回复

使用道具 举报

2

主题

1

听众

1143

积分

助理设计师

Rank: 4

纳金币
350
精华
0
沙发
发表于 2013-10-28 10:42:58 |只看该作者
感谢楼主分享
回复

使用道具 举报

0

主题

1

听众

1174

积分

助理设计师

Rank: 4

纳金币
92
精华
0
板凳
发表于 2014-5-7 04:07:56 |只看该作者
感謝分享!
回复

使用道具 举报

0

主题

2

听众

3238

积分

中级设计师

Rank: 5Rank: 5

纳金币
0
精华
0

最佳新人 活跃会员 热心会员 灌水之王 突出贡献

地板
发表于 2014-5-7 09:57:13 |只看该作者
谢谢分享!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

手机版|纳金网 ( 闽ICP备2021016425号-2/3

GMT+8, 2024-11-16 14:38 , Processed in 0.104649 second(s), 26 queries .

Powered by Discuz!-创意设计 X2.5

© 2008-2019 Narkii Inc.

回顶部