# 3d isometric projection matrix?

I have 3d vectors that I want to project as 2d vectors to draw my shapes. I got a 3d vector cameraPosition, a 3d vector cameraDirection, a float renderDistance. I need to create an orthogonal / isometric matrix with those values to project my 3d vectors.

Here is what I currently have :

matrix4x4(vec3 camera, vec3 camreaDir, vec3 camreraScale){
//get isometric projection matrix
camreraScale.x; //unused member : z

matrix[0][0] = xImage.x;
matrix[1][0] = 0;
matrix[2][0] = zImage.x;
matrix[0][1] = xImage.y;
matrix[1][1] = camreraScale.y;
matrix[2][1] = zImage.y;
}


You should try having a separate camera and projection matrix, since isometric projection is just ortographic with a very specific camera placement.

If you are using a modern matrix library (you should be), then those two can be created with built-in methods. The projection matrix is just an ortographic matrix, the camera matrix is a model matrix, where you first rotate the camera -45 degrees along the xz plane (y axis) and then -30 degrees along the yz plane (x axis). You could also move it back, but if you set the near and far values of your projection matrix so that it can show stuff behind the camera too, then you won't have any problems with it.

If your library doesn't have these functions or you rolled your own, then you can just replicate them based off of these pictures:

Projection matrix:

Rotation matrices:

• So I create all of those and then I combine them to get the expected result ? (I can't use libraries) – Telno Mar 12 '19 at 18:45
• @Telno Yeah, but make sure the multiplication order is correct – Bálint Mar 12 '19 at 19:13
• What are right left exactly ? Far and near are probably distances to camera. – Telno Mar 12 '19 at 19:54
• @Telno The right and left coordinates of the view. Same for the top and bottom. For instance if you have a rectangle going from (-3, -3) to (0, 0) and your left and top is -3 and -3, then it will occupy the top left corner – Bálint Mar 12 '19 at 20:59