Hii,
I’m totally new to three.js and I’m running into some problems while importing scripts.
I’m trying to import a 3D model, which I use the ObjectLoader for. However, when I try to run the model on a localhost, I get an error. I just have my basic index.html file. In there I call the ObjectLoader and the three.js file.
The error I constantly get says:
Uncaught SyntaxError: Unexpected token {
Referring to the ObjectLoader.js file, which starts with:
import {
UVMapping,
CubeReflectionMapping,
CubeRefractionMapping,
EquirectangularReflectionMapping,
EquirectangularRefractionMapping,
SphericalReflectionMapping,
CubeUVReflectionMapping,
CubeUVRefractionMapping,
RepeatWrapping,
ClampToEdgeWrapping,
MirroredRepeatWrapping,
… and so on.
I tried different loader and all, but it just doesn’t seem to work with me.
The only loader that did work for me was the OBJLoader (which I got from a different folder), but with that loader I can’t seem to load .jpg files for the material.
Please help me, near desperately!
Sincerely,
Zeemeeuw