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: Lightwave3Dからアニメーション付きColladaを書き出すよ

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

	public class Lightwave2Collada extends Sprite
	{
		public var dae:DAE;
		public var target:DisplayObject3D;
		public var view:BasicView;
		public var light:PointLight3D;

		public function Lightwave2Collada()
		{
			view = new BasicView();
			this.addChild(view);
                        
                        // Create a new PointLight3d object
                        // PointLight3D(showLight:Boolean = false, flipped:Boolean = false)
                        light = new PointLight3D(true, true);
                        view.scene.addChild(light);
                        light.y = 800;
                        light.x = 500;
                        
			// Create a new dae object. dae was transrated from Lightwave fromat
                        // DAE(autoPlay:Boolean = true, name:String = null, loop:Boolean = false)
			dae = new DAE(true,null,true);
			dae.scale = 200;
			dae.load("http://www.ahiru.org/works/pv3d/colladaExport/sampleSwf/export.dae");
			view.scene.addChild(dae);

                        //target.replaceMaterialByName(cellShaderMat, "all");
			
			// Setting the camera
			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();
		}
	}
}