Hei there!
Probably this has been resolved somewhere but I cannot find it.
I have a simple Box Geometry and on top of that I want to put as a texture a transparent SVG.
My problem is that everything becomes transparent instead of keeping the color of the top of face of the cube.
This is my code:
scope.cubeGeo = new THREE.BoxBufferGeometry( 100, 40, 100 );
scope.cubeGeo.translate( 0, 20, 0 );
scope.cubeMaterial[0] = new THREE.MeshLambertMaterial({color:0xC0C0C0,flatShading:true}); //right
scope.cubeMaterial[1] = new THREE.MeshLambertMaterial({color:0xC0C0C0,flatShading:true});
scope.cubeMaterial[2] = new THREE.MeshLambertMaterial({ color: 0xC0C0C0, map: new THREE.TextureLoader().load( texture )}); //top
scope.cubeMaterial[3] = new THREE.MeshLambertMaterial({color:0xC0C0C0,flatShading:true});
scope.cubeMaterial[4] = new THREE.MeshLambertMaterial({color:0xC0C0C0,flatShading:true});
scope.cubeMaterial[5] = new THREE.MeshLambertMaterial({color:0xC0C0C0,flatShading:true});
//Resource
scope.Mesh = new THREE.Mesh( scope.cubeGeo, scope.cubeMaterial );
I cannot understand what I am doing wrong.
Thanks for any help
I attach the resulting error…