Hi i would like to share the code to edit the pivot of a sprite3D
Add this function to Sprite3D class:
private var _regX : Number = .5;
private var _regY : Number = .5;
public function moveRegistration(x:Number, y:Number):void
{
x = Math.max(0, Math.min(1, x)) - .5;
y = Math.max(0, Math.min(1, y)) - .5;
if(_regX == x && _regY == y) return;
_geometry.updateVertexData(Vector.<Number>([-.5 - x, .5 + y, .0, .5 - x, .5 + y, .0, .5 - x, -.5 + y, .0, -.5 - x, -.5 + y, .0]));
}
Usage:
x and y must be in the range 0-1
0,0 is the top left corner
1,1 is the bottom right corner