|
| 1 | +<Page |
| 2 | + x:Class="UITests.Shared.Windows_UI_Xaml_Media.Projection.Matrix3DProjection_Basic" |
| 3 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 4 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 5 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 7 | + mc:Ignorable="d" |
| 8 | + Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> |
| 9 | + |
| 10 | + <ScrollViewer> |
| 11 | + <StackPanel Spacing="20" Padding="20"> |
| 12 | + <TextBlock Text="Matrix3DProjection - Custom 3D Matrix" FontSize="24" FontWeight="Bold" /> |
| 13 | + <TextBlock Text="Matrix3DProjection allows you to apply a custom 4x4 transformation matrix for advanced 3D effects." TextWrapping="Wrap" /> |
| 14 | + |
| 15 | + <!-- Identity Matrix --> |
| 16 | + <Border Background="#E8F5E9" Padding="15" CornerRadius="8"> |
| 17 | + <StackPanel> |
| 18 | + <TextBlock Text="Identity Matrix (No Transform)" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,10" /> |
| 19 | + <Border Background="White" CornerRadius="4" Padding="30" HorizontalAlignment="Center"> |
| 20 | + <Rectangle x:Name="IdentityRect" Fill="#4CAF50" Width="100" Height="100" /> |
| 21 | + </Border> |
| 22 | + <Button Content="Apply Identity Matrix" Click="OnApplyIdentity" Margin="0,10,0,0" HorizontalAlignment="Center" /> |
| 23 | + </StackPanel> |
| 24 | + </Border> |
| 25 | + |
| 26 | + <!-- Translation Matrix --> |
| 27 | + <Border Background="#E3F2FD" Padding="15" CornerRadius="8"> |
| 28 | + <StackPanel> |
| 29 | + <TextBlock Text="Translation via Matrix3D" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,10" /> |
| 30 | + <Grid> |
| 31 | + <Grid.ColumnDefinitions> |
| 32 | + <ColumnDefinition Width="*" /> |
| 33 | + <ColumnDefinition Width="200" /> |
| 34 | + </Grid.ColumnDefinitions> |
| 35 | + |
| 36 | + <StackPanel Grid.Column="0" Spacing="5"> |
| 37 | + <Slider x:Name="TranslateXSlider" Header="Translate X" Minimum="-50" Maximum="50" Value="0" /> |
| 38 | + <Slider x:Name="TranslateYSlider" Header="Translate Y" Minimum="-50" Maximum="50" Value="0" /> |
| 39 | + <Slider x:Name="TranslateZSlider" Header="Translate Z" Minimum="-100" Maximum="100" Value="0" /> |
| 40 | + <Button Content="Apply Translation" Click="OnApplyTranslation" Margin="0,10,0,0" /> |
| 41 | + </StackPanel> |
| 42 | + |
| 43 | + <Border Grid.Column="1" Background="White" CornerRadius="4" Padding="30" HorizontalAlignment="Center" VerticalAlignment="Center"> |
| 44 | + <Rectangle x:Name="TranslationRect" Fill="#2196F3" Width="80" Height="80" /> |
| 45 | + </Border> |
| 46 | + </Grid> |
| 47 | + </StackPanel> |
| 48 | + </Border> |
| 49 | + |
| 50 | + <!-- Scale Matrix --> |
| 51 | + <Border Background="#FFF3E0" Padding="15" CornerRadius="8"> |
| 52 | + <StackPanel> |
| 53 | + <TextBlock Text="Scale via Matrix3D" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,10" /> |
| 54 | + <Grid> |
| 55 | + <Grid.ColumnDefinitions> |
| 56 | + <ColumnDefinition Width="*" /> |
| 57 | + <ColumnDefinition Width="200" /> |
| 58 | + </Grid.ColumnDefinitions> |
| 59 | + |
| 60 | + <StackPanel Grid.Column="0" Spacing="5"> |
| 61 | + <Slider x:Name="ScaleXSlider" Header="Scale X" Minimum="0.5" Maximum="2" Value="1" StepFrequency="0.1" /> |
| 62 | + <Slider x:Name="ScaleYSlider" Header="Scale Y" Minimum="0.5" Maximum="2" Value="1" StepFrequency="0.1" /> |
| 63 | + <Button Content="Apply Scale" Click="OnApplyScale" Margin="0,10,0,0" /> |
| 64 | + </StackPanel> |
| 65 | + |
| 66 | + <Border Grid.Column="1" Background="White" CornerRadius="4" Padding="30" HorizontalAlignment="Center" VerticalAlignment="Center"> |
| 67 | + <Rectangle x:Name="ScaleRect" Fill="#FF9800" Width="80" Height="80" /> |
| 68 | + </Border> |
| 69 | + </Grid> |
| 70 | + </StackPanel> |
| 71 | + </Border> |
| 72 | + |
| 73 | + <!-- Perspective Matrix --> |
| 74 | + <Border Background="#F3E5F5" Padding="15" CornerRadius="8"> |
| 75 | + <StackPanel> |
| 76 | + <TextBlock Text="Perspective Effect" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,10" /> |
| 77 | + <TextBlock Text="Adjusting M34 creates a perspective effect" TextWrapping="Wrap" Margin="0,0,0,10" /> |
| 78 | + <Grid> |
| 79 | + <Grid.ColumnDefinitions> |
| 80 | + <ColumnDefinition Width="*" /> |
| 81 | + <ColumnDefinition Width="200" /> |
| 82 | + </Grid.ColumnDefinitions> |
| 83 | + |
| 84 | + <StackPanel Grid.Column="0" Spacing="5"> |
| 85 | + <Slider x:Name="PerspectiveSlider" Header="Perspective (M34)" Minimum="-0.005" Maximum="0" Value="-0.001" StepFrequency="0.0001" /> |
| 86 | + <Slider x:Name="PerspectiveRotationY" Header="Rotation Y" Minimum="-60" Maximum="60" Value="30" /> |
| 87 | + <Button Content="Apply Perspective" Click="OnApplyPerspective" Margin="0,10,0,0" /> |
| 88 | + </StackPanel> |
| 89 | + |
| 90 | + <Border Grid.Column="1" Background="White" CornerRadius="4" Padding="30" HorizontalAlignment="Center" VerticalAlignment="Center"> |
| 91 | + <Rectangle x:Name="PerspectiveRect" Fill="#9C27B0" Width="80" Height="80" /> |
| 92 | + </Border> |
| 93 | + </Grid> |
| 94 | + </StackPanel> |
| 95 | + </Border> |
| 96 | + </StackPanel> |
| 97 | + </ScrollViewer> |
| 98 | +</Page> |
0 commit comments