I believe this has been mentioned in several blog posts (such as this one), but I missed one important part, and it took me almost an hour to figure out why my CompositeTransform3D does not give a nice 3D effect but only a “scaling” effect.
Turn out I need to have to put a PerspectiveTransform3D in the container of the element with CompositeTransform3D.
1 2 3 4 5 6 7 8 9 10 11 |
<Grid> <Grid.Transform3D> <PerspectiveTransform3D /> </Grid.Transform3D> <Grid Width="100" Height="100"> <Grid.Transform3D> <CompositeTransform3D CenterX="50" CenterZ="-50" RotationY="45" /> </Grid.Transform3D> <Rectangle Fill="Red" /> </Grid> </Grid> |