设置3d rotationY 旋转之后元件大小改变解决方案

在工作中做类似3D图片切换功能的时候,设置了所有图片元件的rotationY之后,发现图片元件越靠近舞台右边旋转之后大小就越大。

针对此问题特别写了一个demo,代码如下:

请在fla文件中绘制一个元件并导出类TestMC,TestMC不需要做任何改变。

import flash.display.MovieClip;



var a:TestMC = new TestMC();

var b:TestMC = new TestMC();

var c:TestMC = new TestMC();



var aa:MovieClip = new MovieClip();

aa.addChild(a);

var bb:MovieClip = new MovieClip();

bb.addChild(b);

var cc:MovieClip = new MovieClip();

cc.addChild(c);



this.addChild(aa);

this.addChild(bb);

this.addChild(cc);



aa.y = 20;

bb.y = 20;

cc.y = 20;

aa.x = 20;

bb.x = aa.x + aa.width + 20;

cc.x = bb.x + bb.width + 20;



var per:PerspectiveProjection = new PerspectiveProjection();

per.projectionCenter = new Point(0,0);

aa.transform.perspectiveProjection = per;

bb.transform.perspectiveProjection = per;

cc.transform.perspectiveProjection = per;



a.rotationY = 20;

b.rotationY = 20;

c.rotationY = 20;

你可能感兴趣的:(解决方案)