The canonical view volume aka normalized device coordinates is/are left-handed. This is easy to test by passing the identity matrix and drawing 2 triangles say
float points[] = { -1, 1, -0.5,
-1, -1, -0.5,
1, -1, -0.5,
1, 1, 0.5,
-1, -1, 0.5,
1, -1, 0.5 };
and looking at the results (with glEnable(GL_DEPTH_TEST))
So your vertex shader will look like this:
uniform mat4 mvp_mat;
// Incoming per vertex... position (fills in 1 for w if from vec3 buf)
layout (location = 0) in vec4 v_vertex;
void main(void)
{
// multiplying by identity doesn't transform the geometry
gl_Position = mvp_mat * v_vertex;
}
or you could even test it more simply like this since the identity matrix does nothing
layout (location = 0) in vec4 v_vertex;
void main(void)
{
//no transformation, no confusion, just straight to OpenGL
gl_Position = v_vertex;
}
Obviously you'll have to make the colors of the triangles different so you can see how they overlap.
Also see this post and my comment/question in it:
plus.google.com/114825651948330685771/posts/AmnfvYssvSe
I don't know where all the incorrect information comes from all over the internet and even in textbooks. OpenGL is only right handed by default if you're talking about triangle winding for determining the front face (CCW by default = right handed). World space, object space and eye space don't exist to OpenGL, only to the graphics programmer. OpenGL just takes points, clips anything outside of the canonical view volume [-1, -1, -1] x [1, 1, 1] and transforms them to screenspace/window coordinates which by default is [0, w) x [0, h) x [0, 1]. If the depth test is enabled the default behavior is left-handed, looking down +z.
There are several ways to account for OpenGL's left-handedness. Most people handle it in their matrices (though they don't realize it). I think you can also change it using glDepthFunc and setting it to GL_GREATER.
http://www.opengl.org/sdk/docs/man3/xhtml/glDepthFunc.xml
Further proof that it is left handed is here
http://www.opengl.org/sdk/docs/man3/xhtml/glDepthRange.xml
"After clipping and division by w, depth coordinates range from -1 to 1, corresponding to the near and far clipping planes" ie positive z goes into the screen = left-handed. You can also use DepthRange to change to right-handed behavior.
EDIT: In Response to Bob Cross's insistence that I'm wrong, here's a single source file program that shows that I'm right. https://github.com/rswinkle/opengl_reference/blob/master/src/left_handed.c
You can see the screenshot in the README
https://github.com/rswinkle/opengl_reference