Three JS OBJloader - obj not importing properly

i’m trying to import an obj with OBJLoader but it isn’t importing properly

The obj is like this -
23

And it’s importing this -
30

What happens is that the whole objt isn’t importing well.

What can i do about it ?

The code that i’m doing is

   var objLoader = new THREE.OBJLoader();
        var mtlLoader = new THREE.MTLLoader();
            mtlLoader.setTexturePath("obj2/");
            mtlLoader.setPath(  "obj2/"  );
            mtlLoader.load( "Mules/Base_10.mtl", function( materials ) {
                materials.preload();
                objLoader.setMaterials( materials );
                objLoader.load( 'obj2/Mules/Base_10.obj', function ( object ) {
                
                        object.traverse( function ( child )
                        {
                            if ( child instanceof THREE.Mesh )
                            {
                                meshes.push(child);
                            }
                        });
                        var object = meshes[meshes.length-1];
                        object.position.y = -0.05;
                        object.position.x = 0;
                        object.position.z = 0;
                        
                        object.name = "salto";
                        scene.add(object);
                    }, onProgress, onError );
            });

Thank you

Can you share the obj file?

Also, why have you named a model of a shoe “house_obj”? That’s just guaranteed to cause confusion.

1 Like

Base_10.mtl (236 Bytes)
Base_10.obj (434.8 KB)

i copied the wrong file name :smiley: sorry now it’s ok :slight_smile:

There is the obj file.

Thank you for replying

When importing your files at https://blackthread.io/loader/ (which uses OBJLoader), I get the following result:

image

2 Likes

It’s all ok.

i was defining the object again " var object = meshes[meshes.length-1]; " .

Thanks for the help :smiley: