I want to build a room with THREE.js starting from a cube. So far I have the following code:
function loadModelcube() {
console.log("Inside the function");
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 );
With the code above, the cube is not visible as is expected. Also, I don't see the console logging being printed out as expected (ie due to the function loadModelcube()
being called). Does anyone know what is going wrong?