Hi Guys,

I am trying to import a simpel 3ds file (it's a box), made in 3ds
max.
I convert it to editble mesh and add a uvw map.
After two days of trying parts all examples on the main site, in the
thrunk, on this site, etc
I am crying out for help!!!!

I made this code (below) and I think the problem is somewhere in the
last part.
It looks like the code want to load it, but i can't get it to wait to
load the box.3ds
I also at some primitives to see if the cams where working.

I will opload my nice box.3ds

I use the latest away3D with Adobe Flex 3

Please help me out, thanks in advance!

package
{
    import away3d.cameras.*;
    import away3d.containers.*;
    import away3d.loaders.*;
    import away3d.primitives.SeaTurtle;
    import away3d.primitives.Sphere;
    import away3d.events.*;
    import away3d.loaders.data.*;
    import away3d.core.base.*;
    import flash.display.*;
    import flash.events.*;

    [SWF(backgroundColor="#000000")]

    public class Basic01 extends Sprite
    {
        private var cam:TargetCamera3D;
                private var view:View3D;
                private var sphere:Sphere;
                private var beest:SeaTurtle;
                private var box:Object3DLoader;
        public function Basic01()
        {
                // set camera
                cam = new TargetCamera3D({zoom:5,focus:200});

            // create a viewport
            view = new View3D({camera:cam,x:200,y:200});
            addChild(view);

            // cam position
            cam.z = -2000;
            cam.x = -2000;
            cam.y = -5000;

                // create a sphere and put it on the 3D stage
            sphere = new Sphere();
            sphere.x = -500;
                view.scene.addChild(sphere);

            beest = new SeaTurtle();
            beest.x = 500;
            view.scene.addChild(beest);

           // render the view
            view.render();

            box = Max3DS.load("assets/box.3DS",
{material:"green#blue",rotationX:-90});
                        box.addOnSuccess(onLoaderSuccess);
                        view.scene.addChild(box);

        }
                        public function onLoaderSuccess(e:Event):void {

                view.scene.addChild(box);
                }
                        view.render();


        }
    }

Reply via email to