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

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