Export (0) Print
Expand All

GeometryModel3D.Material Property

Updated: January 2010

Gets or sets the Material that is used to render the front of this GeometryModel3D.

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

public Material Material { get; set; }
For XAML information, see the Material type.

Property Value

Type: System.Windows.Media.Media3D.Material
The Material that is used to render the front of this GeometryModel3D.

Identifier field

MaterialProperty

Metadata properties set to true

None

The following code excerpt defines a SolidColorBrush as a DiffuseMaterial on a GeometryModel3D.

<ModelVisual3D>
  <ModelVisual3D.Content>
    <GeometryModel3D Geometry="{StaticResource myTeapot}">
      <GeometryModel3D.Material>
        <DiffuseMaterial>
          <DiffuseMaterial.Brush>
            <SolidColorBrush Color="Blue" Opacity="1.0" />
          </DiffuseMaterial.Brush>
        </DiffuseMaterial>
      </GeometryModel3D.Material>
      <GeometryModel3D.Transform>
        <RotateTransform3D>
          <RotateTransform3D.Rotation>
            <AxisAngleRotation3D x:Name="myAngleRotation" Axis="0,3,0" Angle="1" />
          </RotateTransform3D.Rotation>
        </RotateTransform3D>
      </GeometryModel3D.Transform>
    </GeometryModel3D>
  </ModelVisual3D.Content>
</ModelVisual3D>

More Code

How to: Apply Material to the Front and Back of a 3-D Object The following example shows how to apply a Material to the front and back of a 3-D object and animate the object to show both sides of the object. The Material property of a GeometryModel3D is used to apply a red Brush to the front side of the object and the BackMaterial property of the GeometryModel3D is used to apply a blue Brush to the back side of the object. The code below shows the application of the materials to the object:

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.

.NET Framework

Supported in: 3.5, 3.0

Date

History

Reason

January 2010

Updated description.

Information enhancement.

Community Additions

ADD
Show:
© 2014 Microsoft