In three.js, I am trying to import a arrow json file, apon loading it I get
this error
This is the json loader class I made:
class jsonFileLoader {
readUrl (url) {
this.rawdata = fs.readFileSync(url);
return JSON.parse(this.rawdata);
}
}
and here is the code that loads the json file:
let JsonLoader = new jsonFileLoader();
let loader = new THREE.ObjectLoader();
let jsonData = JsonLoader.readUrl('src/mesh/arrow.json');
let arrowMesh = loader.parse(jsonData);
scene.add( arrowMesh );
Here is my Code sandbox
question from:
https://stackoverflow.com/questions/65855278/upload-a-json-file-in-three-js 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…