




已阅读5页,还剩2页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
Unity3D游戏开发之蒙皮布料Skinned cloth in the scene view and in the inspector.蒙皮布料在场景和检视面板中。TheSkinnedClothcomponent works together with theSkinnedMeshRendererto simulate clothing on a character. If you have an animated character which uses the SkinnedMeshRenderer, you can add a SkinnedCloth component to the game object with the SkinnedMeshRenderer to make him appear more life-like. Just select the GameObject with the SkinnedMeshRender, and add a SkinnedCloth component usingComponent-Physics-Skinned Cloth. 蒙皮布料组件与蒙皮网格渲染组件一起模拟角色身上的衣服。如果你的动画角色使用了蒙皮网络渲染,那么你可以为其增加一个蒙皮布料来让其更真实。只需要选择具有蒙皮网络渲染组件的物件,使用Component-Physics-Skinned Cloth操作来增加蒙皮布料。文章出处【狗刨学习网】。 What the SkinnedCloth component does, is to take the vertex output from the SkinnedMeshRenderer and apply clothing simulation to that. The SkinnedCloth component has a set of per-vertex coefficients, which define how free the simulated cloth can move with respect to the skinned mesh. 当使用蒙皮布料组件时,它将从蒙皮网格渲染组件中获取顶点,并根据这些顶点来模拟布料。蒙皮布料可以对每个顶点设置参数,这些参数定义模拟布料相对蒙皮移动的自由度。 These coefficients can be visually edited using the scene view and the inspector, when the game object with the SkinnedCloth component is selected. There are two editing modes, selection and vertex painting. In selection mode, you click on vertices in the scene view to select them, and then edit their coefficients in the inspector. In vertex paining mode, you set the coefficient values you want in the inspector, enable the paint button next to those coefficients you want to change, and click on the vertices to apply the values to those. 当你在场景或检视面板中选中了一个带有蒙皮布料组件的对象时,这些参数将被可见的设置。有两种设置方式,选择模式和喷涂模式,在选择模式,你在场景中选择相应的顶点,来设置其参数。在喷涂模式,你设置好参数后,点击对应的paint按钮,然后选择顶点来设置这些参数。 Note that skinned cloth simulation is only driven by the vertices skinned by the SkinnedMeshRenderer, and will not otherwise interact with any colliders. This makes skinned cloth simulation much faster then the fully physical Interactive Cloth component, as it does not need to be simulated on the same frame rate and the same thread as the rest of the physics simulation. 记住,蒙皮布料只会被蒙皮网格渲染组件的蒙皮的顶点驱动,而不会和其他碰撞体交互。这使得蒙皮布料比完全的物理交互布料的模拟要快,它不需要像其它物理模拟一样,在同一线程按固定帧率模拟。 You can disable or enable the skinned cloth component at any time to turn it on or off. Turning it off will switch rendering to the normal SkinnedMeshRenderer, so you can switch between these whenever needed to dynamically adjust for varying performance. You can also smoothly cross-fade between the two modes from a script using the SkinnedCloth.SetEnabledFading() method, to make the transition unnoticeable to the player. 你可以在任何时候激活或冻结互动布料组件来使其开启或关闭,关闭将渲染为普通的蒙皮网格渲染,所以你可以在动态的切换来实现很多效果。采用(文章出自狗刨学习网)SkinnedCloth.SetEnabledFading()方法可以使其效果平滑的淡入淡出,来使得玩家忽视其切换。Cloth Coefficients 布料参数 There a four coefficients per vertex, which define how cloth vertices can move with respect to the skinned vertices and normals. These are: 对每个顶点,都有四个参数可以设置,这些参数定义了布料顶点相对蒙皮顶点与法线的运动范围。它们是: Max Distance最大距离Distance a vertex is allowed to travel from the skinned mesh vertex position. The SkinnedCloth component makes sure that the cloth vertices stay within maxDistance from the skinned mesh vertex positions. If maxDistance is zero, the vertex is not simulated but set to the skinned mesh vertex position. This behavior is useful for fixing the cloth vertex to the skin of an animated character - you will want to do that for any vertices which shouldnt be skinned, or for parts which are somehow fixed to the characters body (such as the waist of trousers, fixed by a belt). However, if you have large parts of the character which should not use cloth simulation (such as the face or hands), for best performance, set those up as a separate skinned mesh, which does not have a SkinnedCloth component.最大距离。一个布料顶点到蒙皮网格顶点的最大距离。蒙皮布料组件让布料顶点与蒙皮顶点的距离始终在最大距离范围内。如果最大距离为,那么顶点将不模拟而是直接设为蒙皮顶点的位置。这种方式用于设置某些布料店孤独在角色的蒙皮上很有用用于某些不蒙皮的顶点,以及一些角色固定在角色身体上的东西(比如裤子的腰部,被腰带固定住)。如果大部分不需要布料模拟的话(比如面部或手部),最好的方式还是将其分离为独立的不带互动布料组件的蒙皮网格。 Distance Bias距离偏移Distorts the sphere defined by the maxDistance based on skinned mesh normals. The feature is disabled for a value of 0.0 (default). In this case the max distance sphere is undistorted. Decreasing the maxDistanceBias towards -1.0 reduces the distance the vertex is allowed to travel in the tangential direction. For -1.0 the vertex has to stay on the normal through the skinned mesh vertex position and within maxDistance to the skinned mesh vertex position. Increasing maxDistanceBias towards 1.0 reduces the discance the vertex is allowed to travel in the normal direction. At 1.0 the vertex can only move inside the tangental plane within maxDistance from the skinned mesh vertex position.偏心距。基于蒙皮网格法线,根据最大距离来扭曲这个球。值为时不生效,也就是球不发生扭曲。从0到-1.0将在正切方向上减少顶点的移动范围。当为-1.0时,这个顶点只允许在蒙皮顶点到最大距离范围间沿法线移动。从0到1.0减少顶点沿法线移动的距离。当为1.0时,顶点只能在蒙皮顶点到最大距离范围间沿正切方向移动。 Collision Sphere Radius and Collision Sphere Distance碰撞球半径和碰撞球距离Definition of a sphere a vertex is not allowed to enter. This allows collision against the animated cloth. The pair (collisionSphereRadius, collisionSphereDistance) define a sphere for each cloth vertex. The spheres center is located at the position constrainPosition - constrainNormal * (collisionSphereRadius + collisionSphereDistance) and its radius is collisionSphereRadius, where constrainPosition and constrainNormal are the vertex positions and normals generated by the SkinnedMeshRenderer. The SkinnedCloth makes sure that the cloth vertex does not enter this sphere. This means that collisionSphereDistance defines how deeply the skinned mesh may be penetrated by the cloth. It is typically set to zero. collisionSphereRadius should be set to a value larger then the distance between the neighboring vertices to make sure the cloth vertices will not be able to slip around the collision spheres. In such a setup, the cloth will appear to collides against the skinned mesh.碰撞球半径及碰撞球距离。定义一个顶点无法进入的球。该球可以与模拟布料进行碰撞。这对参数为每个布料顶点定义了一个球。这个球的球心在constrainPosition - constrainNormal * (collisionSphereRadius + collisionSphereDistance)(很难描述,看图即知),半径为collisionSphereRadius。 Refer to this image for a visual representation on how these coefficients work with respect to a skinned vertex and normal for different values of maxDistanceBias. The red area is the collision sphere defined by collisionSphereRadius and collisionSphereDistance, which the cloth vertex cannot enter. Thus, the green area, defined by maxDistance and maxDistanceBias subtracted by the red area defines the space in which the cloth vertex can move. 下图列出了在不同的最大偏心距情况下这些参数是怎样在蒙皮顶点与法线参考系中作用的。红的区域是由碰撞球半径和碰撞球距离定义的碰撞球,它是布料顶点不能进入的区域。绿的区域,由最大距离与最大偏心距决定,它除去红色的区域,就是空间中布料顶点可以活动的区域。The SkinnedCloth inspector 蒙皮布料检视面板 When you select a GameObject with a SkinnedCloth component, you can use the SkinnedCloth inspector to edit cloth vertex coefficients, and other properties. The inspector has three tabs: 当你选择了一个具有蒙皮布料组件的对象时,你可以在蒙皮布料检视面部中编辑顶点参数和其他属性。检视面板有三个标签。文章出处【狗刨学习网】Vertex Selection Tool 顶点选择工具 In this mode you can select vertices in the scene view, and the set their coefficients in the inspector (see the previous section for an explanation on how the cloth coefficients work). It is possible to set multiple coefficients by holding the shift key, or by dragging a rectangle with the mouse. When multiple vertices are selected, the inspector will display average values for the vertices coefficients. When you change the values, however, that coefficient will be set to the same value for all vertices. If you switch the scene view to wireframe mode, you will also be able to see and to select back-facing vertices, this can be useful when you want to select full parts of the character. 在此模式下,你可以在场景视图中选择订单,然后在检视面板照哦功能设置参数(参考前一节对参数的介绍)。按住shift键或者用鼠标框选可以一次设置多个顶点的参数。当你选择多个顶点时,检视面板将显示平均值。当你改变这个值,那么所有的顶点都会被设为同样的值。当场景视图为线框模式时,你可以看到和选择背面的顶点,这种技巧在选择角色的整个部件时比较有用。 To help you understand which values the coefficients have for all the vertices, you can click the eye icon next to a coefficient field, to make the editor visualize that coefficient in the scene view. This shows the vertices with the lowest value of that coefficient in a green tint, mid-range values will be yellow, and the highest values get a blue tint. The colors scale is always chosen relative to the used value range of that coefficient, and is independent of absolute values. 为了帮助你弄清楚所有顶点的参数值分布,你可以选择参数区域边的眼睛图标,编辑器会将这些参数可视化。值小的顶点渲染为绿色,中间范围内的为黄色,最大的为蓝色。这些颜色范围取决于已设置参数的范围。Vertex Painting Tool 顶点喷涂工具 Similar to the vertex selection, this is a tool to help you configure the vertex coefficient values. Unlike vertex selection, you dont need to click on a vertex before changing a value - in this mode, you just enter the values you want to set, enable the paintbrush toggle next to the coefficients you want to change, and then click on all vertices you want to set that value for. 类似于顶点选择,这个工具帮助你配置顶点参数。不同于顶点选择操作方式,你不需要在改变数值之前选中顶点。在这种模式下,你只需要设置好相应的值,激活参数边的画笔开关,然后选中你要设置的顶点。Configuration 配置The third tab lets you configure various properties of the skinned cloth:第三个标签用于配置蒙皮布料的各种属性。 Bending Stiffness抗弯刚度Bending stiffness of the cloth.布料的抗弯刚度。 Stretching Stiffness拉伸刚度Streching stiffness of the cloth.布料的拉伸刚度。 Damping阻尼Damp cloth motion布料运动的阻尼。 Use Gravity使用重力Should gravity affect the cloth s
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 自家打药机转让合同范本
- 污泥清运合同协议书模板
- 窗帘缝纫厂转让合同范本
- 电厂安保合同协议书模板
- 油漆涂料商标转让协议书
- 法律合同保密协议书模板
- 篮球少儿俱乐部合同范本
- 生产企业之间借款协议书
- 防疫临时劳务协议书模板
- 水稻品种权转让合同范本
- DB32-T 5090.1-2025 医院医患沟通规范 第1部分:住院
- 夜市规章制度管理制度
- 浙江杭州钱塘区和达数字资源管理有限公司招聘笔试题库2025
- 《成人慢性肾脏病食养指南(2024年版)》解读
- 联营协议合同模板电子版
- 《蓝莓产品介绍技术》课件
- 集训画室合同协议
- 魔法汉字拓展课件
- 新能源发电系统维护与故障排除手册
- 汽车抵押合同协议
- 中国上海市网红经济行业市场全景调研及投资规划建议报告
评论
0/150
提交评论