本文整理汇总了C#中MeshData.AddBlendTriangle方法的典型用法代码示例。如果您正苦于以下问题:C# MeshData.AddBlendTriangle方法的具体用法?C# MeshData.AddBlendTriangle怎么用?C# MeshData.AddBlendTriangle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MeshData
的用法示例。
在下文中一共展示了MeshData.AddBlendTriangle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddQuadFlatBlend
public virtual MeshData AddQuadFlatBlend( Vector3[] points, MeshData meshData)
{
//Takes 4 points, calculates two normals for two faces
//Adds the points and triangles to the mesh
Vector3 flatnorm1 = new Vector3();
flatnorm1 = Vector3.Cross (points [1] - points [0], points [3] - points [0]);
Vector3 flatnorm2 = new Vector3();
flatnorm2 = Vector3.Cross (points [3] - points [2], points [1] - points [2]);
//set the vertices
meshData.AddVertex(points [0], flatnorm1);
meshData.AddVertex(points [1], flatnorm1);
meshData.AddVertex(points [3], flatnorm1);
meshData.AddBlendTriangle ();
meshData.AddVertex(points [1], flatnorm2);
meshData.AddVertex(points [2], flatnorm2);
meshData.AddVertex(points [3], flatnorm2);
meshData.AddBlendTriangle ();
Color32[] vcolors = new Color32[6];
vcolors [2] = Color.clear;
vcolors [4] = Color.clear;
vcolors [5] = Color.clear;
vcolors [0] = Color.white;
vcolors [1] = Color.white;
vcolors [3] = Color.white;
meshData.colors.AddRange (vcolors);
return meshData;
}