I am uploading a series of .obj and .mtl files for a volume rendering tool developed by WebGL and Three.js. In a part of code I am using OBJMTLLoader to upload the files:
scapula = new THREE.OBJMTLLoader();
scapula.load( 'obj/scapulaTWO.obj', 'obj/scapulaTWO.mtl',
function ( object ) {
object.name = "scapula";
object.scale.set (4,4,4);
vertices = object.geometry.vertices;
scene.add(object);
});
However I can't get access to the vertices. Debugger says that object.geometry is undefined. I have also tried
vertices = new THREE.Mesh(object);
but it didn't work. I would really appreciate if you could help me out.
Thanks in advance.