CompositeTransform3D in Windows 10

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.

<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>

Comments

Leave a comment

Comments are moderated. Only your name, website and comment are stored.