Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

162
Visualizações
Three.Js Whenever i load an obj with objloader extra vertices are added to my object even after using indexed geometry

Hello so as the title says whenever i load an obj file with obj loader along with indexed geometry extra vertices are added to my object and i cant figure out why.

For example when i load my obj without indexed geometry the vertices are the same as the faces of the object ( from what i read this is because of triangle soup) after using BufferGeometryUtils.mergeVertices and then Computing Vertex Normals the vertice count went down almost to the original but not quite.

This is how i use obj loader

loader= new OBJLoader()
var textureLoader = new THREE.TextureLoader(loadingManager);
var map = textureLoader.load('Castle.jpg'); 
var material = new THREE.MeshPhysicalMaterial({map: map, vertexColors: true});

loader.load( 'Castle.obj', function ( obj ) {
    
    obj.children[0].geometry = BufferGeometryUtils.mergeVertices(obj.children[0].geometry);     
    obj.children[0].computeVertexNormals();

    obj.traverse( function ( node ) {

        if ( node.isMesh ) 
        {
        node.material = material;
        
        }

      } );
    scene.add(obj)
} 
);

My 2 obj files which i work with have these stats Castle.obj Vertices :220.153 On three.js 270.532

Ball.obj Vertices: 95.213 on three.js 123.357

The face count remains the same. Am i doing something wrong? If i use the deprecated Geometry everything works properly however since it's deprecated i dont know if it's the right thing to do. Im on version 0.136

Best regards

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda