Combining Rotation and Other Transforms

If you keep all CenterX, CenterY, and CenterZ properties set to their default values of 0, and you define a ScaleTransform3D with equal ScaleX, ScaleY, and ScaleZ properties, you can combine that ScaleTransform3D and a RotateTransform3D in a Transform3DGroup, and the ordering doesn't matter. If the ScaleTransform3D scales differently in different dimensions, you need to decide whether the scaling takes place along non-rotated or rotated axes. Introduce a TranslateTransform3D into the mix and the order of the transforms makes a big difference. This difference is most dramatically illustrated in the following program.

Example 3-4. RotationAndRevolution.xaml

<!-- ======================================================== ...

Get 3D Programming for Windows® 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.