Graphics3D[Sphere[
Flatten[Table[{i,j,k},{i,-2,2},{j,-2,2},{k,-2,2}],2],Flatten[Table[Mod[i+j,2]*(1-(k+2)/4),{i,-2,2},{j,-2,2},{k,-2,2}],2]]]