Currently, I am facing an issue with THREEjs r83 in a requirejs setup. The problem is that the OrbitControl loads and runs before THREEjs initializes, resulting in a persistent error:
Uncaught ReferenceError: THREE is not defined
In the beginning of my file, you can see where THREE is required as a shim for the OrbitControl. Despite going through the code multiple times, I have been unable to find a solution. Any assistance would be greatly appreciated.
requirejs.config({
paths: {
three: 'lib/three'
},
shim: {
'three': ["lib/FloatFix"],
'lib/OrbitControls': ["three"]
}
});
require(
[
'jquery',
'three',
'lib/OrbitControls'
],
...