views:

296

answers:

1

I've got three boxes rotating around their Z axis respectively. What I'm trying to do is keep them rotating around their respective Z axis without distorting if I move them away from the center of my stage.

addEventListener(Event.ENTER_FRAME, rotateBoxes);

function rotateBoxes(e:Event):void
{
    box1.rotationY-=10;
    box2.rotationY+=10;
    box3.rotationY-=10;
}

example here http://www.hupcapstudios.com/tween1.swf

is there a built in parameter like...

box1.globalPerspective = false;

it's more noticeable rotating around the x axis

example http://www.hupcapstudios.com/tweenXswf

+1  A: 

You need to set the perspectiveProjection of your clip to its center... see: http://help.adobe.com/en%5FUS/AS3LCR/Flash%5F10.0/flash/geom/PerspectiveProjection.html#projectionCenter

Something like this should work if the registration point of your clip is at its center:

var pp:PerspectiveProjection=new PerspectiveProjection();
pp.projectionCenter = new Point(clip.width/2,clip.height/2);
clip.transform.perspectiveProjection = pp;
Cay