System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets a collection of triangle indices for the MeshGeometry3D.

Namespace:   System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)

public Int32Collection TriangleIndices { get; set; }
public:
property Int32Collection^ TriangleIndices {
	Int32Collection^ get();
	void set(Int32Collection^ value);
}
member TriangleIndices : Int32Collection with get, set
Public Property TriangleIndices As Int32Collection

Property Value

Type:

Collection that contains the triangle indices of the MeshGeometry3D.

For a triangle in a given 3-D mesh, the order in which the triangle's vertex positions are specified determines whether the triangle face is a front or back face.

The Windows Presentation Foundation 3-D implementation uses a counter-clockwise winding order; that is, the points that determine a front-facing mesh triangle's positions should be specified in counterclockwise order, as viewed from the front of the mesh.

Setting the property is optional. If the indices are not specified, triangles are drawn in a non-indexed fashion. Every set of three positions becomes a triangle.

Identifier field

TriangleIndicesProperty

Metadata properties set to true

None

<GeometryModel3D>
  <GeometryModel3D.Geometry>
          <MeshGeometry3D 
              Positions="-1 -1 0  1 -1 0  -1 1 0  1 1 0"
              Normals="0 0 1  0 0 1  0 0 1  0 0 1"
              TextureCoordinates="0 1  1 1  0 0  1 0   "
              TriangleIndices="0 1 2  1 3 2" />
      </GeometryModel3D.Geometry>
      <GeometryModel3D.Material>
          <DiffuseMaterial>
              <DiffuseMaterial.Brush>
                  <SolidColorBrush Color="Cyan" Opacity="0.3"/>
              </DiffuseMaterial.Brush>
          </DiffuseMaterial>
      </GeometryModel3D.Material>
  <!-- Translate the plane. -->
      <GeometryModel3D.Transform>
          <TranslateTransform3D
            OffsetX="2" OffsetY="0" OffsetZ="-1"   >
          </TranslateTransform3D>
      </GeometryModel3D.Transform>
  </GeometryModel3D>
.NET Framework
Available since 3.0
Return to top