You restore the previous view & projection matrices by calling glPopMatrix. This includes the one you previously
set to identity using glLoadIdentity() before pushing.
You then apply a transformation along the Z axis. Since I don’t know what your current matrix mode is and what
your modelview & projection matrices look like, I cannot predict what effect this has.
If your view & projection matrices are both identity, this transforms whatever you draw next outside the unit cube.
In fact, I don’t see you drawing anything. You push your matrices again??
-> It doesn’t work[/QUOTE]
If this is your entire drawing loop, you increase your matrix stack by 3 view-projection matrix pairs every iteration.
Your usage of pushmatrix and popmatrix makes no sense. It would be interesting what your transformation and projection
matrices looked like in the beginning and what you expect to happen.