更改3D注册点以在AS3中旋转
|
有人有我可以用来更改DisplayObjects在3D空间中旋转的中心点的代码吗?我需要它与rotationX,rotationY和rotationZ一起使用。我知道有一种解决方法,可以将每个对象包装在另一个精灵中,并偏移x和y位置,但是我更喜欢数学解决方案。
作为问题的示例,此代码应为星形:
var a=new Sprite()
addChild(a)
a.graphics.lineStyle(0,0xFF0000)
a.graphics.moveTo(10,10)
a.graphics.drawRect(100,100,100,100)
var b=new Sprite()
addChild(b)
b.graphics.lineStyle(0,0)
b.graphics.moveTo(10,10)
b.graphics.drawRect(100,100,100,100)
b.rotationZ=45
...
更新:感谢Alex的提示,我在这里发布了可重用的解决方案:)
没有找到相关结果
已邀请:
1 个回复
谷靛
来自:http://help.adobe.com/zh_CN/FlashPlatform/reference/actionscript/3/flash/geom/Matrix3D.html 希望能帮助到你 :)