<!-- Example 17-26. XAML to host 3D model -->

<Window x:Class="Generate3DMesh.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Generate3DMesh" Height="400" Width="400">

  <Grid x:Name="mainGrid">
    <Viewport3D x:Name="vp">
      <Viewport3D.Camera>
        <PerspectiveCamera Position="5,4,6" LookDirection="-5,-3.75,-6"
                           UpDirection="0,1,0" FieldOfView="10" />
      </Viewport3D.Camera>

      <ModelVisual3D>
        <ModelVisual3D.Content>
          <Model3DGroup>
            <AmbientLight Color="#222" />
            <DirectionalLight Color="#aaa" Direction="-1,-1,-1" />
            <DirectionalLight Color="#aaa" Direction="1,-1,-1" />
          </Model3DGroup>
        </ModelVisual3D.Content>

        <ModelVisual3D x:Name="modelHost" />

      </ModelVisual3D>
    </Viewport3D>
  </Grid>
</Window>

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