In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: flash on 2010-3-9

Get Adobe Flash player
by RobotCaleb 03 Jul 2010
    Embed
/**
 * Copyright RobotCaleb ( http://wonderfl.net/user/RobotCaleb )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/i54Q
 */

// forked from cac's flash on 2010-3-9
package {
    import flash.events.Event;
    import org.papervision3d.materials.WireframeMaterial;
    import org.papervision3d.objects.primitives.*;
    import org.papervision3d.view.BasicView;
    
    public class Sample2 extends BasicView {
        private var sphere:Sphere // 球面のインスタンス
        public function Sample2():void {
            // マテリアルを作成
            var material:WireframeMaterial = new WireframeMaterial(0xFF0000);
            
            // 3Dオブジェクトを作成
            sphere = new Sphere(material, 300, 20, 20);
            
            // 3Dシーンに追加して、表示させる
            scene.addChild(sphere);
            
            // レンダリングを開始
            startRendering();
            
            // エンターフレームを設定
            addEventListener(Event.ENTER_FRAME, loop);
        }
        
        private function loop(e:Event):void {
            // 球面をY軸方向に回転
            sphere.rotationY += 1;
        }
    }
}