Something like:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glViewport(0, 0, width, height); /* viewport size in pixels */
will mean that the 3D point (0,0,0) is in the center of the viewport,
and that
(1,1,0) is the top-right corner of the viewport.
To get a 1:1 pixel mapping, with (0,0,0) in the top-left of the
viewport and (width,height,0) in the bottom-right, do this:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glScalef(2.0f / (float)width, -2.0f / (float)height, 1.0f);
glTranslatef(-((float)width / 2.0f), -((float)height / 2.0f), 0.0f);
glViewport(0, 0, width, height); /* viewport size in pixels */