Combining Transform3Ds

In 3D, it’s common to apply three transforms to an object: scale, rotate, and translate (generally in that order). To apply multiple transforms, use a Transform3DGroup. The following XAML shows the typical usage of a Transform3DGroup:

<Transform3DGroup>  <ScaleTransform3D x:Name="Size" ScaleX="1" ScaleY="1" ScaleZ="1"/>  <RotateTransform3D>  <RotateTransform3D.Rotation>    <AxisAngleRotation3D x:Name="Orientation" Axis="0,1,0" Angle="0"/>  </RotateTransform3D.Rotation>  </RotateTransform3D>  <TranslateTransform3D x:Name="Position" OffsetX="0" OffsetY="0" OffsetZ="0"/></Transform3DGroup>

Get XAML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.