From OpenGL 4.3, 17.3.6:
If depth clamping (see section 13.5) is enabled, before the incoming fragment’s zw is compared, zw is clamped to the range [min(n; f ); max(n; f )]
i am assuming that by default it is GL_LEQUAL.
That's why you should post fully working examples when you don't know what's going on. The default depth test is GL_LESS
. 1.0 is not less than 1.0, so all of your 0.5
depth vertices fail the depth test.
Also, your loop:
vertices[3*i+2]*=25
This is overwriting memory. Your index is going far off the end of the array, since it only has 24 elements. You probably meant to loop 8.