simple 3d

by uwi
次に作る物の伏線。
♥0 | Line 26 | Modified 2009-07-13 03:51:11 | MIT License
play

ActionScript3 source code

/**
 * Copyright uwi ( http://wonderfl.net/user/uwi )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/iL54
 */

package {
    import flash.display.*;
    import flash.events.*;
   
    // 次に作る物の伏線。
    [SWF(width=465, height=465, frameRate=60, backgroundColor=0xdddddd)]
    public class FlashTest extends Sprite {
        private var bmp : Bitmap;
        
        public function FlashTest() {
            var bmd : BitmapData = new BitmapData(100, 100);
            for(var x : int = 0;x < 100;x++){
                for(var y : int = 0;y < 100;y++){
                    bmd.setPixel(x, y, ((x * 255 / 100) << 8) | (y * 255 / 100));
                }
            }
            
            bmp = new Bitmap(bmd);
            addChild(bmp);
            bmp.x = 200;
            bmp.y = 200;
            
            addEventListener(Event.ENTER_FRAME, onEnterFrame);
        }
        
        private function onEnterFrame(e : Event) : void
        {
           bmp.rotationZ += 5;
           bmp.rotationY += 10;
        }
    }
}