title: Rotating a 3D coordinate
body: <p>I need to rotate a single coordinate in WPF - C#.</p>
  
  <p>The values <code>x, y,z</code> stored in <code>GeometryModel3D[]</code> points.</p>
  
  <p>For example, coordinate(x, y, z) rotate at speficic-axis.</p>
  
  <p>[UPDATE] Rotation transformation using quaternion. The problem are I don't get the new vector value and when I view the pointcloud, It seem drag away in Meshlab.</p>
  
  <pre><code>Matrix3D m = Matrix3D.Identity;
  Quaternion q = new Quaternion(new Vector3D(320 / 2, y, maxDepth - minDepth), 90);
  m.Rotate(q);
  Vector3D myVectorToRotate = new Vector3D(((TranslateTransform3D)points[i].Transform).OffsetX,                        ((TranslateTransform3D)points[i].Transform).OffsetY,     ((TranslateTransform3D)points[i].Transform).OffsetZ);
  
  m.Transform(myVectorToRotate);
  pointcloud.Add(new Point3D(myVectorToRotate.X,myVectorToRotate.Y,myVectorToRotate.Z));
  </code></pre>
  
  <p>I'm still can't get the correct value transformation.</p>
  
  <p>I want to apply rotation transformation for 2nd point cloud scanned from kinect. Since the 1st scan data don't involved rotation, the code for capture data and usage is like below:</p>
  
  <pre><code>for (int y = 0; y &lt; 240; y += resolution)
  {
      for (int x = 0; x &lt; 320; x += resolution)
      {
          if (((TranslateTransform3D)points[i].Transform).OffsetZ &gt;= minDepth
                &amp;&amp; ((TranslateTransform3D)points[i].Transform).OffsetZ &lt;= maxDepth)
          {
              pointcloud.Add(new Point3D(((TranslateTransform3D)points[i].Transform).OffsetX,                                                        ((TranslateTransform3D)points[i].Transform).OffsetY,                                              ((TranslateTransform3D)points[i].Transform).OffsetZ));
          }
          i++;
      }
  }
  </code></pre>