I'm trying to smoothen a mesh I loaded using THREE.OBJLoader
As you can see in this original image all polygons are faceted. I've tried other loaders/formats but get the same result. After rooting around I see that a possible solution is to merge the vertices before computing the normals. When I try this i get "TypeError: geometry.mergeVertices is not a function" in my console. Here is the code, highlighting where I've inserted the mergeVertices() function.
var loader = new THREE.OBJLoader();
loader.load('../assets/models/nos2.obj', function (nos) {
var material = new THREE.MeshLambertMaterial({color: 0xffffff, side:THREE.DoubleSide});
nos.children.forEach(function (child) {
child.material = material;
child.geometry.mergeVertices(); /* ADDED MERGE WHICH GIVES ERROR */
child.geometry.computeFaceNormals();
child.geometry.computeVertexNormals();
});
nos.scale.set(300, 300, 300);
nos.rotation.x = -0.3;
scene.add(nos);}
What am I doing wrong?