In your original code, your gluPerspective call positions your near clipping plane at 0.1 and your far clipping plane at 100.

You draw your triangle with z = 0. Look at the third parameter of your...