I am interested in applying a transparent material to the front-side faces of a geometry. It's a fairly simple process:
var normal = new THREE.MeshNormalMaterial();
normal.side = THREE.BackSide;
var materials = [
normal,
new THREE.MeshBasicMaterial( { transparent: true, opacity: 0 } )
];
for( var i = 0; i < geometry.faces.length; i++ ) {
geometry.faces[ i ].materialIndex = 0;
}
//a 'hole' to look inside
geometry.faces[ 0 ].materialIndex = 1;
geometry.faces[ 1 ].materialIndex = 1;
mesh = new THREE.Mesh( geometry, new THREE.MeshFaceMaterial( materials ) );
Example link on Codepen: http://codepen.io/pyort/pen/egqbLY
However, there is a twist: when viewing the front-side of a face, I want to display what is underneath the geometry, not the backside.
It may be challenging to explain in simple terms, so here is a visual representation: https://i.sstatic.net/KKf0L.png
My goal is to create a 'portal' effect, where looking from one side gives the appearance of depth, but from other angles it appears super thin. How can I achieve this effect? Should I use a shader or mirror techniques?
Thank you.