Combining Translation and Scaling

It is common to apply multiple transforms to the same model or visual. To do this, you need to define the transform to be a Transform3DGroup:

<GeometryModel3D.Transform>
    <Transform3DGroup>
        ...
    </Transform3DGroup>
</GeometryModel3D.Transform>

This Transform3DGroup can have multiple children. You might know now (or you'll discover in Chapter 7) that combining transforms is equivalent to matrix multiplication, and in general, matrix multiplication is not commutative. The order that the transforms appear in the Transform3DGroup makes a difference.

For multiple transforms of the type TranslateTransform3D, this is not a problem. The composite effect is simply the sum of the OffsetX, OffsetY, and OffsetZ properties. If ...

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.