First: I believe you still did not get what is meant by glOrtho. It sets the dimensions of your 3d Cordinate System. You would like to have it good long, wide and deep, so that you are comfortable drawing a moving shape in it. The sytanx ist:
void glOrtho( GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top,
GLdouble nearVal,
GLdouble farVal);
Thus if you want to draw a cube that is about 30 wide and 30 long and 30 deep and also move it around within the cordinate system up to 640 in x and 400 in top
glOrtho(0, 640, 0, 400, -50.0f, 50.0f);
Now, the big difference to your posted code are the last two values. They specify the near Value and far Value of your cordinate system.
Nearvar, Farvar specify the distances to the nearer and farther depth clipping planes. These values are negative if the plane is to be behind the viewer.
Thus, if you do not plan to anim your shape in z direction, its range should be at least as big as the shape's dimension, otherwise it will be clipped. And that is what exactly happened in your code. Since zou use negative z values, you also need to specify negative nearVal.
Point 2: Your shapes are still a little screwed. Play around once you have set your new glOrtho. It will work then.
Point 3: You need Color for your every shape, as they would appear meshed, once you …