title: Rotate 3D cube in WPF
body: <p>I make a 3D cube in WPF with the XAML code like this:</p>
  
  <pre><code>&lt;Viewport3D Name="viewport3D1"&gt;
              &lt;Viewport3D.Camera&gt;
                  &lt;PerspectiveCamera x:Name="camMain" Position="6 5 4" LookDirection="-6 -5 -4"&gt;
                  &lt;/PerspectiveCamera&gt;
              &lt;/Viewport3D.Camera&gt;
              &lt;ModelVisual3D&gt;
                  &lt;ModelVisual3D.Content&gt;
                      &lt;DirectionalLight x:Name="dirLightMain" Direction="-1,-1,-1"&gt;
                      &lt;/DirectionalLight&gt;
                  &lt;/ModelVisual3D.Content&gt;
              &lt;/ModelVisual3D&gt;
              &lt;ModelVisual3D&gt;
                  &lt;ModelVisual3D.Content&gt;
                      &lt;GeometryModel3D&gt;
                          &lt;GeometryModel3D.Geometry&gt;
                              &lt;MeshGeometry3D x:Name="meshMain"
                                  Positions="0 0 0  1 0 0  0 1 0  1 1 0  0 0 1  1 0 1  0 1 1  1 1 1"
                                  TriangleIndices="2 3 1  2 1 0  7 1 3  7 5 1  6 5 7  6 4 5  6 2 0  2 0 4  2 7 3  2 6 7  0 1 5  0 5 4"&gt;
                              &lt;/MeshGeometry3D&gt;
                          &lt;/GeometryModel3D.Geometry&gt;
                          &lt;GeometryModel3D.Material&gt;
                              &lt;DiffuseMaterial x:Name="matDiffuseMain"&gt;
                                  &lt;DiffuseMaterial.Brush&gt;
                                      &lt;SolidColorBrush Color="Red"/&gt;
                                  &lt;/DiffuseMaterial.Brush&gt;
                              &lt;/DiffuseMaterial&gt;
                          &lt;/GeometryModel3D.Material&gt;
                      &lt;/GeometryModel3D&gt;
                  &lt;/ModelVisual3D.Content&gt;
              &lt;/ModelVisual3D&gt;
          &lt;/Viewport3D&gt;
  </code></pre>
  
  <p>Then is constructor of my window, I want to apply rotations around axis OX, OY, OZ which I think is supposed to be done like this:</p>
  
  <pre><code>RotateTransform3D myRotateTransform = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 2, 0), 1));
          meshMain.Transform=myRotateTransform;
          // etc...
  </code></pre>
  
  <p>It seems I don't apply transform to proper node of XAML, what it the right way to effect transform in my case?</p>