0

Im trying to make my own 3D engine using LWJGL.
This is the Line of Code which creates the projection matrix for the uniform to pass.
pMatrix = new Matrix4f().ortho(-2f, 2f, -1.125f, 1.125f, 0.1f, 1000f);
Perfectly working Orthographic Projection
Notice how the rendered mesh is square, correct according to the vertices
Only changing this one line to
pMatrix = new Matrix4f().perspective((float) Math.toRadians(60.0f), 640/360,0.1f, 1000f);
Breaks It
Not Properly working Perspective projection
Notice how in the second image , the mesh is not square
Is there something that im doing wrong. If yes , please help me fix it. If not then why is this happening.

httpdigest
  • 5,411
  • 2
  • 14
  • 28

0 Answers0