<Window x:Class="TransformExamples.Scale"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="ScaleTransform3D" Height="300" Width="300"
    >
  <Viewbox Grid.Row="1" ClipToBounds="True">
    <Border BorderBrush="Black" BorderThickness="1" Margin="2">

      <Viewport3D ClipToBounds="True" Width="300" Height="200">
        <Viewport3D.Camera>
          <PerspectiveCamera Position="0,1,4" LookDirection="0,-1,-4"
                   UpDirection="0,1,0" FieldOfView="45" />
        </Viewport3D.Camera>
        <Viewport3D.Resources>
          <ResourceDictionary>
          </ResourceDictionary>
        </Viewport3D.Resources>

        <ModelVisual3D>
          <ModelVisual3D.Content>
            <Model3DGroup>
              <AmbientLight Color="#333333" />
              <DirectionalLight Color="#FFFFFF" Direction="0.0156948,-0.897322,-0.4410982" />
              <DirectionalLight Color="#FFFFFF" Direction="0.795738,0.0155303,-0.605442" />
            </Model3DGroup>
          </ModelVisual3D.Content>


          <!-- Example 17-21. ScaleTransform3D -->

          <ModelVisual3D Content="{StaticResource cylinderModel}">
            <ModelVisual3D.Transform>
              <ScaleTransform3D ScaleX="2" ScaleY="0.25" ScaleZ="2" />
            </ModelVisual3D.Transform>
          </ModelVisual3D>

          <!-- End of Example 17-21. -->

        </ModelVisual3D>
      </Viewport3D>

    </Border>
  </Viewbox>
</Window>