I came across this code snippet:
function loadObject(filePath){
var loader = new THREE.OBJLoader();
loader.load(
filePath,
function ( object ) {
child = object.children[0];
var geometry = new THREE.Geometry().fromBufferGeometry( child.geometry );
var material = new THREE.MeshBasicMaterial({wireframe: true});
model = new THREE.Mesh(geometry, material);
scene.add(model);
},
function ( xhr ) {
console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );
},
function ( error ) {
console.log( 'An error occurred' );
}
);
};
The file man.obj
contains 214 vertices and 332 faces. However, when I check the number of faces using model.geometry.faces.length
, it returns 332 which is correct.
Surprisingly, when I use model.geometry.vertices.length
, it gives me 996 instead of 214...
Can anyone explain why this discrepancy exists?