Currently, my setup involves using ThreeJS to import a scene as shown in the code snippet below:
$(document).ready(function(){
var scene = new THREE.ObjectLoader().load("scene.js");
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
var renderer = new THREE.WebGLRenderer();
var fly = new THREE.OrbitControls(camera);
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
var gui = new dat.GUI();
gui.add(controls, 'rotationSpeed',0,100);
camera.position.z = 5;
camera.position.z = 32;
function render() {
requestAnimationFrame( render );
renderer.render( scene, camera );
}
render();
});
var controls = new function() {
this.rotationSpeed = 0.02;
this.bouncingSpeed = 0.03;
};
Here is the link to the scene I am using (Exported from ThreeJS editor):
However, when attempting to load the scene, an error message repeatedly appears stating "cannot read property 'fog' of undefined" and "undefined is not a function". What could be causing this issue? How can it be resolved?