thanks for your reply
I have used ur cod but I`ve get Error
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
at away3d.loaders::Obj/parseMtl()
at away3d.loaders::Loader3D/onMtlComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
do you know what is it this Error?
many thanks for your help.
On Mar 11, 1:41 pm, Julian Cruz <[email protected]> wrote:
> Try it this, it's work it for me
>
> import away3d.containers.*;
> import away3d.cameras.*;
> import away3d.loaders.*;
> import flash.events.Event;
> import flash.display.Loader;
> var camera:Camera3D = new Camera3D({z:-50,x:-30,y:10});
> var scene:Scene3D = new Scene3D();
> var view:View3D = new View3D({camera:camera,scene:scene});
> var loader:Loader3D = Obj.load("resources/myObject3D.obj");
>
> addChild(view);
> scene.addChild(loader);
>
> addEventListener(Event.ENTER_FRAME,enterFrame);
>
> function enterFrame(e:Event):void
> {
> view.render();
>
> }
>
> 2011/3/11 Jam <[email protected]>
>
>
>
> > Hi, I’m looking for loading mesh (my 3Dobject with the name:
> > myObject3D.obj) in Flash CS5 but Im beginner at Away 3D also I have
> > chosen working with away3D for my final project. I have made my 3D
> > object in Maya and exported as an .obj now I need to import it to
> > flash and work with away 3D but after lots of research and buying the
> > away3D book I had no successes.
> > Now I am working with Away3D Version 2.5.0 / 3.5.0:
> > In CS5, Flash10,
> > Then as an example I have used the one of Examples but its not
> > working.
>
> > I really need some help to continue working on my final project.
>
> > Many thanks for your time and your help
>
> > // import core library
> > import away3d.core.scene.*;
> > // import file format loaders
> > import away3d.loaders.*;
>
> > // create a 3D-viewport
> > var view:View3D = new View3D({x:300, y:200});
> > // add viewport to the stage
> > addChild(view);
>
> > // start mesh loading
> > var loader:Object3DLoader = Obj.load("resources/myObject3D.obj",
> > {material:"turtle_texture", name:"turtle", scaling:0.1, y:50, x:10, z:
> > 10, rotationX:-90, loadersize:300});
> > // add the loader object to the scene
> > view.scene.addChild(loader);
>
> > // every frame
> > addEventListener(Event.ENTER_FRAME, onEnterFrame);
> > function onEnterFrame(event:Event):void {
> > // rotate loader or mesh around Y-axis
> > loader.handle.rotationY = getTimer() / 100;
>
> > // rerender viewport on each frame
> > view.render();
> > }
>
> > I really need some help to continue working on my final project.- Hide
> > quoted text -
>
> - Show quoted text -