CompositeTransform3D Behavior
Posted: 06 Jan 2022, 21:59
Out of curiosity, why are elements in the top stack rotated differently compared to the elements in the bottom stack panel? (it is a cut and paste of the same XAML). Even if CompositeTrasnform3D coordinates are global, would the result look like this?


Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Top">
<Grid Width="300" Height="200" Margin="20">
<noesis:Element.Transform3D>
<noesis:CompositeTransform3D RotationY="-5" CenterX="150" />
</noesis:Element.Transform3D>
<Rectangle Fill="Gray"/>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">A</TextBlock>
</Grid>
<Grid Width="300" Height="200" Margin="20">
<noesis:Element.Transform3D>
<noesis:CompositeTransform3D RotationY="5" CenterX="150" />
</noesis:Element.Transform3D>
<Rectangle Fill="Gray"/>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">B</TextBlock>
</Grid>
</StackPanel>
<StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Bottom">
<Grid Width="300" Height="200" Margin="20">
<noesis:Element.Transform3D>
<noesis:CompositeTransform3D RotationY="-5" CenterX="150" />
</noesis:Element.Transform3D>
<Rectangle Fill="Gray"/>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">A</TextBlock>
</Grid>
<Grid Width="300" Height="200" Margin="20">
<noesis:Element.Transform3D>
<noesis:CompositeTransform3D RotationY="5" CenterX="150" />
</noesis:Element.Transform3D>
<Rectangle Fill="Gray"/>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center">B</TextBlock>
</Grid>
</StackPanel>
</Grid>