I am trying to use the THREE TransformControls class in a JSBin project that I am creating. Unfortunately, I cannot share my entire code. However, my JS code is within <script type="text/javascript"></script>
HTML tags. All my imports are handled by <script src=""> </script>
HTML tags. I have tried various source URLs for the TransformControls class to no avail.
I have imported the module using: <script src="https://threejs.org/examples/js/controls/TransformControls.js"></script>
but I keep getting a "Script error. (line 0)" as soon as I create a new TransformControls object.
Here is my TransformControls code:
var tC= new THREE.TransformControls(camera, renderer.domElement); // this line causes the error
var cC = new THREE.OrbitControls(camera, renderer.domElement); // camera controls works
tC.addEventListener( 'mousemove', render );
What am I doing wrong?
Disclaimer: I am very new to JavaScript and to THREE
Add crossorigin in your script tag
Code(Will work in jsbin):
Other helpful articles:
Just for knowledge:
Use