change in code: var p = [ 1, 1, 1, 1, 0, 0 ]; // planes px,nx, py,ny, pz,nz -> 0 hide, 1 show