1

I'm trying to display a simple 3D model using three.js instead of the already implemented view I've made in Unity3D. The model is a fbx file and the texture is a 4096x4096 pixel jpg file.

Following the examples and the documentation I created the scene, but the model shows significant visible craks on it, while the same model and texture is rendered perfectly on Unity.

This is a code snippet showing how I've loaded the model and applied the texture on it:

var loader = new THREE.FBXLoader();

loader.load( 'models/s01.fbx', function ( object ) {
                    var texture = new THREE.TextureLoader().load( "models/00.jpg" );
                    object.scale.set( 50,50,50 );
                    object.rotation.x = - Math.PI / 2;
                    object.position.set( 0, 100, 0 );                       

                object.traverse( function ( child ) {

                    if ( child.isMesh ) {                           
                        child.material=  new THREE.MeshBasicMaterial();
                        child.material.map = texture;
                        child.material.needsUpdate = true;
                    }                           
                } );
                scene.add( object );
            } );

The result is shown in the following image:

threeJS render

The same model rendered in Unity:

enter image description here

Did I miss something? Thanks

Edit: I suspect that the artifact has to do with the texture and the UV map. This is the texture ( I scaled it):

enter image description here

h3lios
  • 104
  • 7
  • 1
    Is it possible to share the model and texture in this thread? – Mugen87 Nov 07 '18 at 15:15
  • @Mugen87, I've added the texture, if you need I'll upload also the model. – h3lios Nov 08 '18 at 15:28
  • Yes, please share the model, too. – Mugen87 Nov 08 '18 at 16:24
  • @Mugen87, you can download the mesh and the full res texture from here: https://www.dropbox.com/s/lhzvx5kwadmlymg/export.zip?dl=0 – h3lios Nov 08 '18 at 16:35
  • Your model refers to a `.tiff` image which is not supported by browsers. You have to use `PNG`. Can you please share a `FBX` with correct references to a `PNG` file? – Mugen87 Nov 08 '18 at 17:13
  • @Mugen87, you can download the whole project from here https://www.dropbox.com/s/a5bo64q5ncuwxct/3D.zip?dl=0 Thanks for your help :D – h3lios Nov 09 '18 at 10:18
  • Looks perfectly on Chrome 70.0.3538.77 and macOS 10.13.6. Same with Firefox 63.0.1. I'm not able to see the mention glitches from your screenshot. What browser/OS are you using. – Mugen87 Nov 09 '18 at 11:01

0 Answers0