Edit

Share via


MeshGeometry3D.TriangleIndices Property

Definition

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

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

Property Value

Collection that contains the triangle indices of the MeshGeometry3D.

Examples

<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>

Remarks

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 TriangleIndices 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.

Dependency Property Information

Item Value
Identifier field TriangleIndicesProperty
Metadata properties set to true None

Applies to