本文整理汇总了C#中System.Windows.Media.Media3D.MaterialGroup.Freeze方法的典型用法代码示例。如果您正苦于以下问题:C# MaterialGroup.Freeze方法的具体用法?C# MaterialGroup.Freeze怎么用?C# MaterialGroup.Freeze使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Media.Media3D.MaterialGroup
的用法示例。
在下文中一共展示了MaterialGroup.Freeze方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetColor
private void SetColor(Color color)
{
MaterialGroup unlitMaterial = new MaterialGroup();
unlitMaterial.Children.Add(new DiffuseMaterial(new SolidColorBrush(Colors.Black)));
unlitMaterial.Children.Add(new EmissiveMaterial(new SolidColorBrush(color)));
unlitMaterial.Freeze();
_model.Material = unlitMaterial;
_model.BackMaterial = unlitMaterial;
}
示例2: ColorChanged
/// <summary>
/// Changes the material when the color changed.
/// </summary>
private void ColorChanged()
{
var mg = new MaterialGroup();
mg.Children.Add(new DiffuseMaterial(Brushes.Black));
mg.Children.Add(new EmissiveMaterial(new SolidColorBrush(this.Color)));
mg.Freeze();
this.Model.Material = mg;
}
示例3: GetUnlitMaterial
/// <summary>
/// This returns a material that is the same color regardless of lighting
/// </summary>
public static Material GetUnlitMaterial(Color color)
{
Color diffuse = Colors.Black;
diffuse.ScA = color.ScA;
MaterialGroup retVal = new MaterialGroup();
retVal.Children.Add(new DiffuseMaterial(new SolidColorBrush(diffuse)));
retVal.Children.Add(new EmissiveMaterial(new SolidColorBrush(color)));
retVal.Freeze();
return retVal;
}
示例4: SetColor
private void SetColor(Color color)
{
MaterialGroup unlitMaterial = new MaterialGroup();
Color diffuse = Colors.Black;
diffuse.ScA = color.ScA;
unlitMaterial.Children.Add(new DiffuseMaterial(new SolidColorBrush(diffuse)));
unlitMaterial.Children.Add(new EmissiveMaterial(new SolidColorBrush(color)));
unlitMaterial.Freeze();
_content.Material = unlitMaterial;
_content.BackMaterial = unlitMaterial;
}