I am trying to upload my 3D model from an HTML input tag, but I keep encountering this error message:
t.lastIndexOf is not a function
Here's the HTML code I am using:
<input type="file" id="MODEL" />
<button onclick="GLTFLoader()" id="LOAD" type="submit">Load_model</button>
And this is the JavaScript code I have written for loading the model:
function GLTFLoader() {
const MODEL = document.getElementById("MODEL").files[0];
var Mesh;
let LOADER = new THREE.GLTFLoader();
LOADER.load(MODEL, (gltf) => {
Mesh = gltf.scene;
Mesh.scale.set(0.2, 0.2, 0.2);
scene.add(Mesh);
Mesh.position.x = 0;
Mesh.position.y = 10;
Mesh.position.z = 15;
});
}