I am attempting to load an obj
file using Three.js
, but despite following various tutorials and resources online, I am only met with a black screen and no error messages in the console.
The console output from the LoadingManager
indicates that the objects were loaded successfully:
THREE.WebGLRenderer 68 three.min.js:520
Loading: skin.jpg 1 2 app.html:42
Loading: ucd.obj 2 2 app.html:42
Below is my code from the app.html
file:
//Variables
var container, stats;
var camera, scene, renderer;
var mouseX = 0, mouseY = 0;
var windowHalfX = window.innerWidth/2;
var windowHalfY = window.innerHeight/2;
init();
animate();
//Initialization
function init(){
//Code omitted for brevity
}
//Window resize event handler
function onWindowResize(){
//Code omitted for brevity
}
//Mouse move event handler
function onDocumentMouseMove(event){
//Code omitted for brevity
}
//Animation functions
function animate(){
//Code omitted for brevity
}
function render(){
//Code omitted for brevity
}
I'm struggling to understand why my script isn't rendering even the basic outline of my obj
file. Any assistance would be greatly appreciated.