I am trying to load multiple .vtk files with a for loop like such:
for (var i = 0; i < vtkFilesArray.length; i++) {
var loader = new THREE.VTKLoader();
loader.load( i+".vtk", function ( geometry ) {
console.log(geometry);
geometry.center();
geometry.computeVertexNormals();
var mesh = new THREE.Mesh( geometry, material );
mesh.position.set( - 0.075, 0.005, 0 );
mesh.scale.multiplyScalar( 0.2 );
scene.add( mesh );
} );
}
However, after I get the geometry, there is no file ID that can identify back to the mesh. Is there a way to pass along the file ID to the geometry data or attach ID to the dispatched events?