Click or drag to resize
AB4D logo

MultiModelBoxUIElement3DFallbackMaterial Property

Gets or sets the Material that is used when the material for the specified side is not set.

Namespace: Ab3d.UIElements
Assembly: Ab3d.PowerToys (in Ab3d.PowerToys.dll) Version: 11.2.9104.2045
Syntax
C#
[TypeConverterAttribute(typeof(MaterialTypeConverter))]
public Material FallbackMaterial { get; set; }

Property Value

Material
Remarks

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.

Example

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"

XAML
<Viewport3D Name="MainViewport">
    <visuals:MultiMaterialBoxVisual3D CenterPosition="-50 0 0" Size="200 100 50"
                                      FallbackMaterial="Blue" TopMaterial="Red" FrontMaterial="Red"/>
</Viewport3D>
See Also