Export (0) Print
Expand All

MaterialGroup Class

Represents a Material that is a composite of the Materials in its collection.

Namespace: System.Windows.Media.Media3D
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[ContentPropertyAttribute("Children")] 
public sealed class MaterialGroup : Material
/** @attribute ContentPropertyAttribute("Children") */ 
public final class MaterialGroup extends Material
ContentPropertyAttribute("Children") 
public final class MaterialGroup extends Material
<MaterialGroup>
  Children
</MaterialGroup>

Because DiffuseMaterial, SpecularMaterial, and EmissiveMaterial provide distinctly different effects, it's useful to combine them. For example, you might choose to apply a complex texture to a mesh using DiffuseMaterial, while adding a highlighting effect with a SpecularMaterial on the same mesh. MaterialGroup allows you to treat these Materials as a single texture for convenience.

The following excerpt shows a MaterialGroup.

<MaterialGroup x:Key="LeavesMaterial1">
  <DiffuseMaterial>
    <DiffuseMaterial.Brush>
      <ImageBrush Stretch="UniformToFill" ImageSource="sample_images\leaves_closeup.png" TileMode="None" ViewportUnits="Absolute" Viewport="0 0 1 1" AlignmentX="Left" AlignmentY="Top" Opacity="1.000000" />
    </DiffuseMaterial.Brush>
  </DiffuseMaterial>
  <SpecularMaterial SpecularPower="85.3333">
    <SpecularMaterial.Brush>
      <SolidColorBrush Color="#FFFFFF" Opacity="1.000000"/>
    </SpecularMaterial.Brush>
  </SpecularMaterial>
</MaterialGroup>

More Code

How to: Apply Emissive Material to a 3-D Object

The following example shows how to use EmissiveMaterial to add color to an existing Material equal to the color of the EmissiveMaterial's brush. The code below shows DiffuseMaterial and EmissiveMaterial applied in combination to create a add blue to the DiffuseMaterial's appearance.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2014 Microsoft