Sort of following on from where this person was in their topic: Matrix for 2D perspective
What I have at the moment is a transformation matrix that's defined as follows: http://pastebin.com/GM6BhP0R -- The field projMat is just a 4x4 matrix.
I have an array of 3D points that I'm trying to map to the canvas and I'm doing that by first multiplying each vertex (3D point) by a view matrix, which I've just set to the identity matrix for the time being, although if I can get this set up that will be responsible for creating a camera with I suppose.
Lastly I take this newly transformed 3D point and I multiply it by the projection matrix as defined in the code sample above. I was hoping that this would give me the screen coordinates for the points, however there appears to be no depth to the points (e.g. points with a higher Z coordinate should start to taper in, while closer points shouldn't), so objects further away from the camera appear smaller. As I said though, after the transformations it appears to render the points in the same position irrespective of its Z coordinate. Here's how I'm rendering the points (in Java just in case you want to know):
for(int i = 0; i < vertices.length; i++) {
Vector3f transPos = Matrix4f.multiply(projMat, Matrix4f.multiply(viewMat, vertices[i]));
screen.drawPoint((int) transPos.getX(), (int) transPos.getY(), 0xffffffff);
}
As you can see here the inner multiplication just multiplies the vextex (point) with the view matrix, which is set to the identity, then the 3D vector that's produced by that is then multiplied by the projection matrix, which should set it to a perspective view.
If you can see where I've gone wrong I'd appreciate any help.