Red spots in car model.gltf


I have a problem with this model. After I load it it has red spots on it. Any idea how I can fix it?

//code

const loader = new GLTFLoader();

loader.load(’…/assets/scene.gltf’, function( model ) {

const loadedModel = model.scene;

loadedModel.scale.set(0.01,0.01,0.01);

  // PUTING THE MODEL IN CENTER OF THE SCENE

  const box = new THREE.Box3().setFromObject(loadedModel);

  const center = box.getCenter(new THREE.Vector3());

  loadedModel.position.x += (loadedModel.position.x - center.x)

  loadedModel.position.y += (loadedModel.position.x - center.y)

  loadedModel.position.z += (loadedModel.position.x - center.z)

        

  scene.add(loadedModel);

}, undefined,function( error ) {

console.log( ' something is wrong with the model ')

});

Do you mind sharing the glTF asset in this topic?

1 Like

I tried but it seems too big. I can offer the link.

Thank you for replaying.

I can see the same artifacts at Sketchfab and when importing the model at BabylonJS Sandbox. When zooming into the Sketchfab model, you can see the lines pretty clear:

image

When importing the glTF asset into three.js, these objects are imported as instance of LineSegments. You can easily hide these objects by doing this:

loadedModel.traverse( function( object ) {

    if ( object.isLineSegments === true ) object.visible = false;

} );

But keep in mind that this issue is actually a modeling fault.

2 Likes

You made my day :smiley:
Thank you so much

1 Like