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 Scale Transform

The ScaleTransform3D makes a figure larger or smaller by multiplying its X, Y, and Z coordinates by properties named ScaleX, ScaleY, and ScaleZ, all of which have default values of 1. Here's how the ScaleTransform3D might appear in markup to transform a GeometryModel3D:

<GeometryModel3D>
    ...
    <GeometryModel3D.Transform>
        <ScaleTransform3D ScaleX="3" ScaleY="1" ScaleZ="2" />
    </GeometryModel3D.Transform>
</GeometryModel3D>

The figure is effectively widened by a factor of 3 and doubled in size along the Z axis. The ScaleY attribute set the value to its default and can be removed. The scale transform formulas are:

x' = ScaleX * x

y' = ScaleY * y

z' = ScaleZ * z

The ScaleTransformExperimenter.xaml program (not shown here because it's quite ...

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