I'm trying to add OrbitControls, but I always get this error at this instruction:
var controls = new THREE.OrbitControls( camera, renderer.domElement );
I've installed with npm three.js and three-orbitcontrols.js, I've read all the answers but I still can't figure out what I should do. If I use require or import in my jsp page, I still get this problem.
I've also tryied using browserify but it didn't help (I got an EPERM error, so maybe I did something wrong?).
Can someone help me? What did I miss?
Edit: I've realized that I wrote OrbitControls.js instead of three-orbitcontrols.js, so sorry about that. Also, if I try to use import console says:" SyntaxError: Cannot use import statement outside a module"