I have problem with loading collada file into away3d. There is null
object in :

at away3d.loaders::Collada/parseNext()
at away3d.loaders::AbstractParser/update()




 I'm using avay 3D ver 2.5.0/3.5.0. Any suggestions ??

Here is collada file: http://strony.aster.pl/moszoro/temp/lion_final.dae
Here is my code:

package {
        import away3d.containers.Bone;
        import away3d.containers.ObjectContainer3D;
        import away3d.core.utils.Debug;
        import away3d.events.Loader3DEvent;
        import away3d.loaders.Collada;
        import away3d.loaders.Loader3D;
        import away3d.test.SimpleView;
        [SWF(backgroundColor="0xFFFFFF", frameRate="30", width="800",
height="600")]

        /**
         *
         * Away3D Collada Bone Controller
         * @author [email protected]
         *
         */
        public class Away3D extends SimpleView
        {
        private var bone:Bone;

        public function Away3D()
        {
                // just title
                super("Bone","Collada Bone Controller Example by katopz");
        }

        override protected function create() : void
        {
                        // for debug lover
                        Debug.active = true;

                        // load and wait...
                        var loader:Loader3D = Collada.load("lion_final.dae");
                        loader.addOnSuccess(onLoaderSuccess);
                        view.scene.addChild(loader);
        }

                private function onLoaderSuccess(event:Loader3DEvent):void
                {
                        // camera auto lookAt target in simple view
                        target = ObjectContainer3D(event.loader.handle);
                        target.scale(100);

            // zoom out
            view.camera.zoom = 4;

            // fun!
                        start();
                }

        override protected function draw() : void
        {
                // rotate around
                view.scene.rotationY+=Math.PI/10;
                view.camera.lookAt(target.position);

                // get neck bone
                if(!bone)
                        bone = 
ObjectContainer3D(target).getBoneByName("joint2");

                // try control
                bone.jointRotationY += (mouseX - 320 - bone.jointRotationY)
* .5;
        }
        }
}

Reply via email to