view.scene.addChild( loader3D );
I would not use this line. You addChild again on ModelLoadSuccess

if you open the obj file, the second line says useMtl + mtl relative url to obj 
file
make sure its located at the expected location

usually obj exports look like this

myModel dir
        myModel.obj
        myModel.mtl
        myModelBitmap.jpg

Fabrice



On Jul 20, 2011, at 3:35 PM, Mahfudz wrote:

> .mtl file must have inside the folder models
> 
> On Wed, Jul 20, 2011 at 9:33 PM, Toidas <[email protected]> wrote:
> I have tried all the methods I have found to load an .obj file, and I’ve 
> tried to load various different .obj files, one of which was working in an 
> example on the net (http://www.charglerode.com/blog/?p=164). However, none of 
> them seem to be working for me. When the parser gets to the .mtl it seems 
> that it freezes. The message “Loading material file… X of X (or sometimes 0) 
> bytes loaded” stays frozen on the screen. For example, here is the variant 
> with the model from the net: 
> http://tadas.asmeninis.com/teravil/flash/example/. A snippet of the code of 
> the example:
> try {
>     var loader3D:Loader3D = Obj.load( "models/m4_sherman.obj", { 
> bothsides:true } );
>     loader3D.addOnSuccess( onModelLoadSuccess );
>     view.scene.addChild( loader3D );
> } catch( err:Error ) {
>     errorHandle( err );
> }
> 
> ...
> 
> protected function onModelLoadSuccess( event:Loader3DEvent ):void {
>     mesh = event.loader.handle;
>     view.scene.addChild( mesh );
> }
>  
>  
> 
> 
> 
> -- 
> Regard,
> Mahfudz
> 
> 
> 

Reply via email to