# When drawing transparent object in OpenGL it cuts some sides of other object?

I am making some OpenGL program, and I have a lost of cubes next to each other like this:

When I am making this hole, I am just skipping those cubes, just don't draw them.

for (int i=0;i<NUM_OF_CUBES;i++) {
for (int j = 0; j < NUM_OF_CUBES; j++) {
if ((i==3 && j==3) || (i==4 && j==3) ||
(i==3 && j==4) || (i==4 && j==4))
continue;
cubes[i][j].draw(true);
}
}


The result is:

But when I make those cubes invisible, by setting alpha to 0, the result is:

The code is:

for (int i=0;i<NUM_OF_CUBES;i++) {
for (int j = 0; j < NUM_OF_CUBES; j++) {
if ((i==3 && j==3) || (i==4 && j==3) ||
(i==3 && j==4) || (i==4 && j==4))
cubes[i][j].draw(true);
else
cubes[i][j].draw(false);
}
}


true/false fleg which I send to draw function just sets alpha to 0 or 1, if true alpha coordinate of glColor4f is set to 0, and if false is sent alpha coordinate is set to 1.

Does anyone have idea why it looks like some sides of the other cubes are cut? Like they don't exist.