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

[papervision3d] Nemuvine

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

// forked from hacker_ah3i35qm's forked from: Lightwave3Dからアニメーション付きColladaを書き出すよ
// forked from noenoe's Lightwave3Dからアニメーション付きColladaを書き出すよ
//Lightwave3Dからアニメーション付きのColladaファイルを書き出すよ
//手順はここにメモっておきましたー → http://www.ahiru.org/archives/135
package {
    import flash.events.Event;
    import flash.display.Sprite;
    
    import org.papervision3d.objects.DisplayObject3D;
    import org.papervision3d.objects.parsers.DAE;
    import org.papervision3d.view.BasicView;

    public class Lightwave2Collada extends Sprite
    {
        public var dae:DAE;
        public var target:DisplayObject3D;
        public var view:BasicView;
        
        public function Lightwave2Collada()
        {
            view = new BasicView();
            this.addChild(view);
                        
            //Lightwaveから変換したCollada形式のオブジェクト
            dae = new DAE(true,null,true);
            dae.scale = 125;
            // dae.load("http://away3d.googlecode.com/svn/branches/lite_builder/bin/nemuvine/nemuvine.dae");
            dae.load("http://www.sleepydesign.com/assets/nemuvine/nemuvine.dae");
            view.scene.addChild(dae);
            
            //カメラのターゲット
            target = new DisplayObject3D();
            target.y = 400;
            view.scene.addChild(target);
            
            view.camera.y = 800;
            view.camera.target = target;
            
            stage.addEventListener(Event.ENTER_FRAME, _enterFrameHandler)
        }

        private function _enterFrameHandler(e:Event):void{
            dae.rotationY += 1;
            view.startRendering();
        }
    }
}