mirror of
https://github.com/Stone-Red-Code/docs-desktop.git
synced 2026-09-07 16:06:07 +02:00
* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
30 lines
1.6 KiB
Markdown
30 lines
1.6 KiB
Markdown
---
|
|
title: "How to: Animate Material Properties in a 3D Scene"
|
|
ms.date: "03/30/2017"
|
|
helpviewer_keywords:
|
|
- "Material properties [WPF], animating in 3D scenes"
|
|
- "animation [WPF], Material properties in 3D scenes"
|
|
- "3D scenes [WPF], animating Material properties"
|
|
ms.assetid: 229fd6eb-7401-4992-b0c9-8b28de230c0f
|
|
---
|
|
# How to: Animate Material Properties in a 3D Scene
|
|
This example shows how to animate the <xref:System.Windows.Media.Brush.Opacity%2A> property of the <xref:System.Windows.Media.Media3D.Material> applied to a 3D model.
|
|
|
|
The following code example defines the <xref:System.Windows.Media.LinearGradientBrush> used as the <xref:System.Windows.Media.Media3D.Material> applied to the 3D object.
|
|
|
|
[!code-xaml[Animation3DGallery_snip#AnimateMaterialExampleInline1](~/samples/snippets/csharp/VS_Snippets_Wpf/Animation3DGallery_snip/CS/AnimateMaterialExample.xaml#animatematerialexampleinline1)]
|
|
|
|
The <xref:System.Windows.Media.Brush.Opacity%2A> property of this <xref:System.Windows.Media.LinearGradientBrush> is animated using the code example below.
|
|
|
|
[!code-xaml[Animation3DGallery_snip#AnimateMaterialExampleInline2](~/samples/snippets/csharp/VS_Snippets_Wpf/Animation3DGallery_snip/CS/AnimateMaterialExample.xaml#animatematerialexampleinline2)]
|
|
|
|
## Example
|
|
The following code shows the entire sample.
|
|
|
|
[!code-xaml[Animation3DGallery_snip#AnimateMaterialExampleWholePage](~/samples/snippets/csharp/VS_Snippets_Wpf/Animation3DGallery_snip/CS/AnimateMaterialExample.xaml#animatematerialexamplewholepage)]
|
|
|
|
## See also
|
|
|
|
- [Create a 3D Scene](how-to-create-a-3-d-scene.md)
|
|
- [3D Graphics Overview](3-d-graphics-overview.md)
|