I have two cylinderGeometries with the tunnel inside the tunnel wrap. I have a png texture with transparency added to the tunnel and a black color to the wrap. I intend to lower the transparency on the tunnelWrap as a alphaMap opacity workaround.
The tunnelWrap appears as transparent when inside the inner tunnel. Why is this? I have tried with much larger radiuses and it was the same result.
function addTunnel(){
var cylTexture = loader.load("wormhole2.png"),
cylGeom = new THREE.CylinderGeometry(5000, 5000, 50000, 32, 32, true),
cylMat = new THREE.MeshPhongMaterial({
map: cylTexture,
side: THREE.DoubleSide,
transparent: true
}),
cyl = new THREE.Mesh(cylGeom, cylMat);
cylTexture.wrapT = THREE.RepeatWrapping;
cylTexture.wrapS = THREE.RepeatWrapping;
cyl.name = "tunnel";
scene.add(cyl);
scene.getObjectByName("tunnel").position.z = -12000;
rotateObject(scene.getObjectByName("tunnel"), -90, 0, 0);
octree.add(scene.getObjectByName("tunnel"));
tunnel = scene.getObjectByName("tunnel");
}
function addTunnelWrap(){
var cylGeom = new THREE.CylinderGeometry(5100, 5100, 50000, 32, 32, true),
cylMat = new THREE.MeshBasicMaterial({
color: 0x000000,
side: THREE.BackSide,
transparent: true
}),
cylWrap = new THREE.Mesh(cylGeom, cylMat);
cylWrap.name = "tunnelWrap";
scene.add(cylWrap);
scene.getObjectByName("tunnelWrap").position.z = -12000;
rotateObject(scene.getObjectByName("tunnelWrap"), -90, 0, 0);
tunnelWrap = scene.getObjectByName("tunnelWrap");
tunnelWrap.material.opacity = 1.0;
}
I think you have the backside and doublesides mixed up.
I made a fiddle http://jsfiddle.net/cg0aayw5/
Perhaps this isn't right, it's difficult to decipher the question.
The fiddle uses a color instead of a texture and an animation of the opacity to show the effect of the opacity on the inside of the cylinder.