假設一個box有8個頂點,12個三角形。
如果使用index來渲染的話,如何構建vertex資源呢?
頂點只有8個,但是uv面有12個,怎么辦呢?
資料如下:
Vertices Count="8"> -44.500526 0.000000 -32.448845 44.500526 0.000000 -32.448845 -44.500526 0.000000 32.448845 44.500526 0.000000 32.448845 -44.500526 35.663357 -32.448845 44.500526 35.663357 -32.448845 -44.500526 35.663357 32.448845 44.500526 35.663357 32.448845 </Vertices>
<Normals Count="24"> 0.000000 -1.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 -1.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 0.000000 0.000000 1.000000 -1.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 </Normals>
-<Faces Count="12">
<FaceVertices> 0 3 2 3 0 1 4 7 5 7 4 6 0 5 1 5 0 4 1 7 3 7 1 5 3 6 2 6 3 7 2 4 0 4 2 6 </FaceVertices>
<FaceNormals> 0 2 1 2 0 3 4 6 5 6 4 7 8 10 9 10 8 11 12 14 13 14 12 15 16 18 17 18 16 19 20 22 21 22 20 23 </FaceNormals>
<MaterialIDs> 1 1 0 0 4 4 3 3 5 5 2 2 </MaterialIDs>
<SmoothingGroups> 2 2 4 4 8 8 16 16 32 32 64 64 </SmoothingGroups>
<EdgeVisibility> 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 1 </EdgeVisibility>
</Faces>
-<MapChannels Count="1">
-<MapChannel Type="Texture" ID="1">
<MapVertices Count="22" Dimension="3"> 0.617626 0.790554 0.000000 0.989379 0.790554 0.000000 0.617626 0.994844 0.000000 0.989379 0.994844 0.000000 0.479802 0.006789 0.000000 0.989626 0.006789 0.000000 0.479803 0.211078 0.000000 0.989626 0.211078 0.000000 0.020000 0.020000 0.000000 0.455348 0.020000 0.000000 0.020000 0.455348 0.000000 0.455348 0.455348 0.000000 0.385141 0.996621 0.000000 0.013389 0.996621 0.000000 0.385141 0.792331 0.000000 0.013389 0.792331 0.000000 0.528876 0.760481 0.000000 0.019053 0.760481 0.000000 0.528876 0.556192 0.000000 0.019053 0.556192 0.000000 0.020000 0.455348 0.000000 0.455348 0.455348 0.000000 </MapVertices>
<MapFaces Count="12"> 9 10 11 10 9 8 8 21 9 21 8 20 4 7 5 7 4 6 0 3 1 3 0 2 16 19 17 19 16 18 12 15 13 15 12 14 </MapFaces>
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/61382.html
標籤:其它游戲引擎
