The dice object here is a 3D skinnable component. In order to keep the perspective
the same when converting it to bitmapData, you need to have your perspectiveProjection properly set.
var ds:DragSource = new DragSource();
dice.transform.perspectiveProjection = new PerspectiveProjection();
dice.transform.perspectiveProjection.projectionCenter = new Point(400,220);
dice.transform.perspectiveProjection.fieldOfView = 10
var bitmapData:BitmapData = BitmapUtil.getSnapshot(dice);
var bitmap:Bitmap = new Bitmap(bitmapData);
var snap:Image = new Image();
snap.width = 80;
snap.height = 80;
snap.load(bitmap);
DragManager.doDrag(dice,ds,event,snap,0,00,1.0);
dice.transform.perspectiveProjection = new PerspectiveProjection();
dice.transform.perspectiveProjection.projectionCenter = new Point(400,220);
dice.transform.perspectiveProjection.fieldOfView = 10
var bitmapData:BitmapData = BitmapUtil.getSnapshot(dice);
var bitmap:Bitmap = new Bitmap(bitmapData);
var snap:Image = new Image();
snap.width = 80;
snap.height = 80;
snap.load(bitmap);
DragManager.doDrag(dice,ds,event,snap,0,00,1.0);
I ended up not even using the drag manager in the application this is from, but the research it took to get this far was too good to forget.
No comments:
Post a Comment