My plan is to create a room using THREE.js starting from a basic cube. Here's what I have written so far:
function loadModelcube() {
console.log("Function executed successfully");
cube.traverse( function( node ) {
if( node.material ) {
node.material.side = THREE.DoubleSide;
}
});
scene.add( cube );
}
var geometry = new THREE.BoxGeometry(100,50,100);
var material = new THREE.MeshBasicMaterial({color: 0xff4444, wireframe: false});
cube = new THREE.Mesh(geometry, material);
var managercube = new THREE.LoadingManager( loadModelcube );
Despite my efforts, the cube doesn't show up as expected and the console log isn't appearing either (due to calling the loadModelcube()
function). Can anyone help me figure out what's going wrong?