とりあえず回してみる
// forked from taiga's forked from: forked from: code on 2008-12-18
package {
import flash.display.Sprite;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.geom.Matrix3D;
import flash.geom.Vector3D;
import flash.utils.Timer;
[SWF (backgroundColor="#ff9900", frameRate="30")]
public class Test extends Sprite {
private const SQUARE_WIDTH :uint = 100;
private const SQUARE_HEIGHT:uint = 100;
private var _s:Sprite;
private var _t:Timer;
public function Test() {
super();
_s = new Sprite();
_s.graphics.beginFill(0x990000);
_s.graphics.drawRect(-SQUARE_WIDTH / 2, -SQUARE_HEIGHT / 2, SQUARE_WIDTH, SQUARE_HEIGHT);
_s.graphics.endFill();
_s.z = 0;
addChild(_s);
_t = new Timer(1000 / stage.frameRate)
_t.addEventListener(TimerEvent.TIMER, timerHandler);
_t.start();
}
private function timerHandler(event:TimerEvent):void {
var d_:Number = 2;
_s.x = stage.stageWidth / 2;
_s.y = stage.stageHeight / 2;
var m3d:Matrix3D = _s.transform.matrix3D;
_s.transform.matrix3D = new Matrix3D();
_s.transform.matrix3D.appendRotation(d_, Vector3D.X_AXIS);
_s.transform.matrix3D.appendRotation(d_, Vector3D.Y_AXIS);
_s.transform.matrix3D.append(m3d);
event.updateAfterEvent();
}
}
}