Mesh with triangles

 An important detail of the triangles is the ordering of the corner vertices. They should be arranged so that the corners go around clockwise as you look down on the visible outer surface of the triangle, although it doesn’t matter which corner you start with.

Remembering the clockwise rule for ordering the corners, the lower left triangle will use 0, 2, 1 as its corner indices, while the upper right one will use 2, 3, 1.

The important thing is that you have to specify the vertices of each triangle in the right order: Each triangle separately, counter-clockwise.

0,3,0--3,3,0
| \        |
|   \      |
|     \    |
|       \  |
|         \|
0,0,0--3,0,0
2\2--3
| \  | Counter-clockwise
|  \ |
0--1\1
int [] indexes = { 2,0,1, 1,3,2 };
http://studentgamedev.blogspot.com/2013/08/unity-voxel-tutorial-part-1-generating.html
http://catlikecoding.com/unity/tutorials/star/
http://blog.nobel-joergensen.com/2010/12/25/procedural-generated-mesh-in-unity/
posted @ 2014-05-30 20:41  penney  阅读(231)  评论(0)    收藏  举报