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

The Translation Transform

Translation is the type of transform that simply moves a figure to another location without changing its size or orientation. The TranslateTransform3D class defines three properties of type double with default values of 0: OffsetX, OffsetY, and OffsetZ. You might want to apply a TranslateTransform3D to a GeometryModel3D element, for example. This requires property element syntax for the Transform property of GeometryModel3D to enclose the TranslateTransform3D element:

<GeometryModel3D>
    ...
    <GeometryModel3D.Transform>
        <TranslateTransform3D OffsetX="2" OffsetY="0" OffsetZ="-1" />
    </GeometryModel3D.Transform>
</GeometryModel3D>

The figure described by the GeometryModel3D is effectively transposed as if you had added 2 to the ...

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