I have been attempting to load multiple .vtk files using a for loop in the following manner:
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, once I obtain the geometry, there is no unique file ID associated with the mesh. Is there a method to pass the file ID along with the geometry data or attach an ID to the events being dispatched?