我想在3d Unity中绘制线条网格。我发现我可以使用Unity4中的MeshTopology.Lines绘制线条。
但是我找不到用MeshTopology.Lines怎么做的例子。如何在Unity 3d中绘制直线?
发布于 2013-01-24 21:28:04
Vector3[] verts = new Vector3[]{Vector3.up, Vector3.right, Vector3.down, Vector3.left};
int[] indicesForLineStrip = new int[]{0,1,2,3,0};
//int[] indicesForLines = new int[]{0,1,1,2,2,3,3,0};
Mesh mesh = new Mesh();
mesh.vertices = verts;
mesh.SetIndicies(indicesForLineStrip, MeshTopology.LineStrip, 0);
//mesh.SetIndicies(indicesForLines, MeshTopology.Lines, 0);
mesh.RecalculateNormals();
mesh.RecalculateBounds();https://stackoverflow.com/questions/13671439
复制相似问题