title: How do I set CATransformLayer animation center of rotation
body: <p>I have a <strong>view</strong> with it's underlying <strong>layer</strong>, and I add a <strong>CATransformLayer</strong> to the view's layer:</p>
  
  <p><strong>[view.layer addSublayer:transformLayer];</strong></p>
  
  <p>My added layer contains all sorts of sublayers representing individual sides of several 3 dimensional blocks. I would like to apply an animation to a layer to rotate the blocks.</p>
  
  <pre><code>CATransform3D rotation = CATransform3DMakeRotation(deg * M_PI / 180, x, y, z);
  [CATransaction begin];
  
      [(CATransformLayer *)[pView.layer.sublayers objectAtIndex:0] setSublayerTransform:rotation];
          or (both seem to produce the same result)
      [(CATransformLayer *)[pView.layer.sublayers objectAtIndex:0] setTransform:rotation];
  
  [CATransaction commit];
  </code></pre>
  
  <p>The problem is the layer is rotating roughly around the front corner instead of the center of the cubes (see below for example).</p>
  
  <pre><code>                    / \                  / \        
     / \            / \ / \              / \ / \      
   / \ / \         |\ / \ /|            |\ / \ /|     
  |\ / \ /|        | |\ /| |            | |\ /| |     
  | |\ /| |         \| | |/ \    OR    / \| | |/      
  |\| | |/|  ==&gt;      \|/ \ / \      / \ / \|/        
  |1|\|/|B|            |\ / \ /|    |\ /   /|         
   \|2|A|/             |A|\ /| |    | |\ /|2|         
     \|/                \|B| |/      \| |1|/          
                          \|/          \|/            
  </code></pre>
  
  <p>The A/B labels should move to the 1/2 positions, or 1/2 should move to A/B, depending on the direction of rotation. Instead it changes from the first figure, rotates roughly around the front corner, resulting in something close to the other figures. The upper unlabeled blocks are in a different view and static so not part of the rotation. The lower labeled blocks are in the view/layer I am trying to animate.</p>
  
  <p>How do I change the center of rotation to achieve my desired result?</p>
  
  <p>I have messed with <strong>anchorPoint</strong>, <strong>zPosition</strong>, <strong>anchorPointZ</strong> for various layers with no success. Have tried <strong>setSublayerTransform</strong>, <strong>setTransform</strong> as well.</p>
  
  <p>Should I be messing with settings for the block side sublayers, the transform layer, the view layer, or the view itself to achieve what I am after?</p>
  
  <p>Any guidance or direction would be appreciated.</p>