.NET Framework Class Library
MeshGeometry3D..::.TriangleIndices Property

Gets or sets a collection of triangle indices for the MeshGeometry3D. This is a dependency property.

Namespace:  System.Windows.Media.Media3D
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax

Visual Basic (Declaration)
Public Property TriangleIndices As Int32Collection
Visual Basic (Usage)
Dim instance As MeshGeometry3D
Dim value As Int32Collection

value = instance.TriangleIndices

instance.TriangleIndices = value
C#
public Int32Collection TriangleIndices { get; set; }
Visual C++
public:
property Int32Collection^ TriangleIndices {
    Int32Collection^ get ();
    void set (Int32Collection^ value);
}
JScript
public function get TriangleIndices () : Int32Collection
public function set TriangleIndices (value : Int32Collection)
XAML Property Element Usage
<object>
  <object.TriangleIndices>
    <Int32Collection .../>
  </object.TriangleIndices>
</object>
XAML Attribute Usage
<object TriangleIndices="Int32Collection" .../>

Property Value

Type: System.Windows.Media..::.Int32Collection
Collection that contains the triangle indices of the MeshGeometry3D.
Dependency Property Information

Identifier field

TriangleIndicesProperty

Metadata properties set to true

None

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.

Examples

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 3.5, 3.0
See Also

Reference

Other Resources

Tags :


Page view tracker