O'Reilly logo

3D Programming for Windows® by Charles Petzold

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required