I built a cube and selected the front and back and gave them both the color red. But when I rotate around the cube the walls are transparent when watched from the back and red when I watch them from the front.
based on the code, you only define front and back. Means top, left, right, bottom are not defined, thus don't generated actual geometry ( no geometry is not the same as transparent geometry .. 🙂 )