title: Change 3D registration point for rotation in AS3
body: <p>Has anyone got a bit of code I can use to change the center point DisplayObjects rotate around in a 3D space? I need it to work with rotationX, rotationY and rotationZ. I know theres a workaround of wrapping every object in aother  sprite and offsetting the x &amp; y positions but I'd much prefer a math solution.</p>
  
  <p>As an example of the problem, this code should make a star shape:</p>
  
  <pre><code>var a=new Sprite()
  addChild(a)
  a.graphics.lineStyle(0,0xFF0000)
  a.graphics.moveTo(10,10)
  a.graphics.drawRect(100,100,100,100)
  
  var b=new Sprite()
  addChild(b)
  b.graphics.lineStyle(0,0)
  b.graphics.moveTo(10,10)
  b.graphics.drawRect(100,100,100,100)
  b.rotationZ=45
  </code></pre>
  
  <p>...</p>
  
  <p><strong>UPDATE</strong>: Thanks to Alex for the tip, I've posted a reusable <strong><a href="http://blog.crondesign.com/2011/04/as3-function-to-rotate-2d-or-3d.html" rel="nofollow">solution here</a> :)</strong></p>