A CS4 flash rotating around the Z axis without distortion for the center of the scene, is it possible?

I have three boxes rotating around their Z-axis respectively. What I am trying to do is make them rotate around their respective Z-axis without distorting if I move them away from the center of my scene.

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

there is a built-in parameter like ...

box1.globalPerspective = false;

      

it is more visible when rotating around the x-axis

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

+2


source to share


1 answer


You need to set the perspective of your clip's projection to the center ... see: http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/geom/PerspectiveProjection.html#projectionCenter

Something like this should work if your clip's registration point is in the center:



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

      

+2


source







All Articles