包含5節(jié)視頻教程
本系列包含Unity3D介紹、Unity3D導(dǎo)出人物、Unity3D導(dǎo)出場(chǎng)景、Unity3D導(dǎo)出動(dòng)作、游戲測(cè)試最終完成一個(gè)簡(jiǎn)單的游戲。是一套非常完整的Unity3D游戲制作教程。
![]()
|
![]()
The SkinnedCloth component works together with the SkinnedMeshRenderer to 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 using Component->Physics->Skinned Cloth. 蒙皮布料組件與蒙皮網(wǎng)格渲染組件一起模擬角色身上的衣服。如果你的動(dòng)畫角色使用了蒙皮網(wǎng)絡(luò)渲染,那么你可以為其增加一個(gè)蒙皮布料來讓其更真實(shí)。只需要選擇具有蒙皮網(wǎng)絡(luò)渲染組件的物件,使用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. 當(dāng)使用蒙皮布料組件時(shí),它將從蒙皮網(wǎng)格渲染組件中獲取頂點(diǎn),并根據(jù)這些頂點(diǎn)來模擬布料。蒙皮布料可以對(duì)每個(gè)頂點(diǎn)設(shè)置參數(shù),這些參數(shù)定義模擬布料相對(duì)蒙皮移動(dòng)的自由度。 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. 當(dāng)你在場(chǎng)景或檢視面板中選中了一個(gè)帶有蒙皮布料組件的對(duì)象時(shí),這些參數(shù)將被可見的設(shè)置。有兩種設(shè)置方式,選擇模式和噴涂模式,在選擇模式,你在場(chǎng)景中選擇相應(yīng)的頂點(diǎn),來設(shè)置其參數(shù)。在噴涂模式,你設(shè)置好參數(shù)后,點(diǎn)擊對(duì)應(yīng)的paint按鈕,然后選擇頂點(diǎn)來設(shè)置這些參數(shù)。 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. 記住,蒙皮布料只會(huì)被蒙皮網(wǎng)格渲染組件的蒙皮的頂點(diǎn)驅(qū)動(dòng),而不會(huì)和其他碰撞體交互。這使得蒙皮布料比完全的物理交互布料的模擬要快,它不需要像其它物理模擬一樣,在同一線程按固定幀率模擬。 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. 你可以在任何時(shí)候激活或凍結(jié)互動(dòng)布料組件來使其開啟或關(guān)閉,關(guān)閉將渲染為普通的蒙皮網(wǎng)格渲染,所以你可以在動(dòng)態(tài)的切換來實(shí)現(xiàn)很多效果。采用SkinnedCloth.SetEnabledFading()方法可以使其效果平滑的淡入淡出,來使得玩家忽視其切換。 Cloth Coefficients 布料參數(shù)There a four coefficients per vertex, which define how cloth vertices can move with respect to the skinned vertices and normals. These are: 對(duì)每個(gè)頂點(diǎn),都有四個(gè)參數(shù)可以設(shè)置,這些參數(shù)定義了布料頂點(diǎn)相對(duì)蒙皮頂點(diǎn)與法線的運(yùn)動(dòng)范圍。它們是:
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. 下圖列出了在不同的最大偏心距情況下這些參數(shù)是怎樣在蒙皮頂點(diǎn)與法線參考系中作用的。紅的區(qū)域是由碰撞球半徑和碰撞球距離定義的碰撞球,它是布料頂點(diǎn)不能進(jìn)入的區(qū)域。綠的區(qū)域,由最大距離與最大偏心距決定,它除去紅色的區(qū)域,就是空間中布料頂點(diǎn)可以活動(dòng)的區(qū)域。 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: 當(dāng)你選擇了一個(gè)具有蒙皮布料組件的對(duì)象時(shí),你可以在蒙皮布料檢視面部中編輯頂點(diǎn)參數(shù)和其他屬性。檢視面板有三個(gè)標(biāo)簽。 Vertex Selection Tool 頂點(diǎn)選擇工具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. 在此模式下,你可以在場(chǎng)景視圖中選擇訂單,然后在檢視面板照哦功能設(shè)置參數(shù)(參考前一節(jié)對(duì)參數(shù)的介紹)。按住shift鍵或者用鼠標(biāo)框選可以一次設(shè)置多個(gè)頂點(diǎn)的參數(shù)。當(dāng)你選擇多個(gè)頂點(diǎn)時(shí),檢視面板將顯示平均值。當(dāng)你改變這個(gè)值,那么所有的頂點(diǎn)都會(huì)被設(shè)為同樣的值。當(dāng)場(chǎng)景視圖為線框模式時(shí),你可以看到和選擇背面的頂點(diǎn),這種技巧在選擇角色的整個(gè)部件時(shí)比較有用。 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. 為了幫助你弄清楚所有頂點(diǎn)的參數(shù)值分布,你可以選擇參數(shù)區(qū)域邊的眼睛圖標(biāo),編輯器會(huì)將這些參數(shù)可視化。值小的頂點(diǎn)渲染為綠色,中間范圍內(nèi)的為黃色,最大的為藍(lán)色。這些顏色范圍取決于已設(shè)置參數(shù)的范圍。 Vertex Painting Tool 頂點(diǎn)噴涂工具Similar to the vertex selection, this is a tool to help you configure the vertex coefficient values. Unlike vertex selection, you don't 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. 類似于頂點(diǎn)選擇,這個(gè)工具幫助你配置頂點(diǎn)參數(shù)。不同于頂點(diǎn)選擇操作方式,你不需要在改變數(shù)值之前選中頂點(diǎn)。在這種模式下,你只需要設(shè)置好相應(yīng)的值,激活參數(shù)邊的畫筆開關(guān),然后選中你要設(shè)置的頂點(diǎn)。 Configuration 配置The third tab lets you configure various properties of the skinned cloth: 第三個(gè)標(biāo)簽用于配置蒙皮布料的各種屬性。
贊0 踩0 |
未知用戶
2005-2025 朱峰社區(qū) 版權(quán)所有 遼ICP備2021001865號(hào)-1
2005-2025 ZhuFeng Community All Rights Reserved
VIP