prespective projection

hello…
I have a question that how can i make a projection for (x,y,z) => (x,y) manualy, using mathematic equations, to represent { glVertex3f(x,y,z) } function in 2D world using glvertex2f(x,y) ???
thanks in advance

This explains how to construct the matrix manually

http://www.cse.wustl.edu/~kjg/cse131/Labs/lab8/PerspectiveProjection.pdf