本文整理汇总了C#中System.Windows.Media.Media3D.Point3DCollection.RemoveAt方法的典型用法代码示例。如果您正苦于以下问题:C# Point3DCollection.RemoveAt方法的具体用法?C# Point3DCollection.RemoveAt怎么用?C# Point3DCollection.RemoveAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Media3D.Point3DCollection
的用法示例。
在下文中一共展示了Point3DCollection.RemoveAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TriangleSubdivide
/// <summary>
///
/// </summary>
/// <param name="vertices"></param>
/// <param name="normals"></param>
/// <param name="indices"></param>
/// <param name="textures"></param>
protected void TriangleSubdivide(Point3DCollection vertices,
Vector3DCollection normals,
Int32Collection indices,
PointCollection textures)
{
for (int i = 0; i < 3; i++)
{
verticesBase[2 - i] = vertices[vertices.Count - 1];
normalsBase[2 - i] = normals[vertices.Count - 1];
texturesBase[2 - i] = textures[vertices.Count - 1];
vertices.RemoveAt(vertices.Count - 1);
normals.RemoveAt(normals.Count - 1);
indices.RemoveAt(indices.Count - 1);
textures.RemoveAt(textures.Count - 1);
}
int indexStart = vertices.Count;
for (int slice = 0; slice <= Slices; slice++)
{
double weight = (double)slice / Slices;
Point3D vertex1 = Point3DWeight(verticesBase[0], verticesBase[1], weight);
Point3D vertex2 = Point3DWeight(verticesBase[0], verticesBase[2], weight);
Vector3D normal1 = Vector3DWeight(normalsBase[0], normalsBase[1], weight);
Vector3D normal2 = Vector3DWeight(normalsBase[0], normalsBase[2], weight);
Point texture1 = PointWeight(texturesBase[0], texturesBase[1], weight);
Point texture2 = PointWeight(texturesBase[0], texturesBase[2], weight);
for (int i = 0; i <= slice; i++)
{
weight = (double)i / slice;
if (Double.IsNaN(weight))
weight = 0;
vertices.Add(Point3DWeight(vertex1, vertex2, weight));
normals.Add(Vector3DWeight(normal1, normal2, weight));
textures.Add(PointWeight(texture1, texture2, weight));
}
}
for (int slice = 0; slice < Slices; slice++)
{
int base1 = (slice + 1) * slice / 2;
int base2 = base1 + slice + 1;
for (int i = 0; i <= 2 * slice; i++)
{
int half = i / 2;
if ((i & 1) == 0) // even
{
indices.Add(indexStart + base1 + half);
indices.Add(indexStart + base2 + half);
indices.Add(indexStart + base2 + half + 1);
}
else // odd
{
indices.Add(indexStart + base1 + half);
indices.Add(indexStart + base2 + half + 1);
indices.Add(indexStart + base1 + half + 1);
}
}
}
}