I have something like this:
var manager = new THREE.LoadingManager();
manager.onProgress = function ( item, loaded, total ) {
console.log( item, loaded, total );
};
var texture = new THREE.Texture();
var loader = new THREE.ImageLoader( manager );
loader.load( 'obj/'+model+'.jpg', function ( image ) {
texture.anisotropy = anis;
texture.image = image;
texture.needsUpdate = true;
} );
var loader = new THREE.OBJLoader( manager );
loader.load( 'obj/'+model+'.obj', function ( object ) {
object.traverse( function ( child ) {
if ( child instanceof THREE.Mesh ) {
child.material.map = texture;
if(reflex){
child.material.envMap = reflection;
child.material.shading = THREE.SmoothShading;
child.material.reflectivity = reflex;
}
}
} );
object.scale.set(10,10,10);
object.position.y = pos;
object.position.z = 0;
object.position.x = 0;
object.name = "model";
scene.add( object );
} );
It works well, but ... all the polygons on the model are visible in this way ...

I would like to smooth things out ... so I read here
that I could smooth them like this:
var smooth = THREE.GeometryUtils.clone( geometry );
smooth.mergeVertices();
var modifier = new THREE.SubdivisionModifier(divisions);
modifier.modify( smooth );
var mesh = new THREE.Mesh( smooth, new THREE.MeshPhongMaterial( { color: 0x222222 } ) );
scene.add( mesh );
But ... I have no idea where I can get this geometry object ... can anyone help me?
source
share