Multi |
[TypeConverterAttribute(typeof(MaterialTypeConverter))] public Material FallbackMaterial { get; set; }
The MultiMaterialBoxVisual3D defines six material properties: TopMaterial, BottomMaterial, LeftMaterial, RightMaterial, FrontMaterial and BackMaterial. They can be used to specify the material for each side of the box.
When more than one side is using the same material and only a few sides have different material, the FallbackMaterial to specify the material that will be used when the specific material for the side is not set.
The following example shows how to create a blue 3D Box with red top and front side.
Note: MaterialTypeConverter is used to simplify defining the materials.
The following namespace declaration needs to be added to the root element: xmlns:visuals="clr-namespace:Ab3d.Visuals;assembly=Ab3d.PowerToys"
<Viewport3D Name="MainViewport"> <visuals:MultiMaterialBoxVisual3D CenterPosition="-50 0 0" Size="200 100 50" FallbackMaterial="Blue" TopMaterial="Red" FrontMaterial="Red"/> </Viewport3D>