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