title: How to rotate a canvas at a specific point using android.graphics.Camera.rotateX(angle)
body: <p>I am trying to use the Camera (android.graphics.Camera not the hardware camera) to rotate a views canvas around a specific point, in this instance the middle of the canvas. </p>
  
  <p>In dispatchDraw(Canvas canvas) -- for brevity I am leaving out all the non important parts. </p>
  
  <pre><code>camera.save();
     camera.rotateX(0);
     camera.rotateY(0);
     camera.rotateZ(angle);
     camera.getMatrix(cameraMatrix);
   camera.restore(); 
  
   canvas.concat( cameraMatrix );
  </code></pre>
  
  <p>The canvas rotates, but always from the upper left hand corner.  </p>
  
  <p>NOTE: Because the canvas has been constructed to be larger than the display area I also need to translate the final result so that it is centered in the display, I can do this with either </p>
  
  <pre><code>canvas.translate(xOffset,yOffset) PRIOR to calling the camera methods
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>cameraMatrix.preTranslate(xOffset,yOffset) AFTER the camera methods
  </code></pre>
  
  <p>Both correctly center the canvas in the display but I can't seem to get the rotation point to be the center for the camera.rotateZ(angle) call, tried using the methods in the 3D android sample but while they seem to work for the X / Y axis them don't seem to affect the Z axis</p>
  
  <p>Any help would be appreciated, the doc's are not exactly verbose.</p>