I have this AR project that I need to transform the screen coordinate to world coordinate. I follow this tutorial and I almost made it.
The only problem when I try to transform from homogeneous clip space to eye space, I use the wrong projection matrix. The reason why the projection matrix is wrong because I cannot get the right width and height of the camera space. I used this library called Kudan, when i move the camera phone forward and backward, I expect the camera width and height to change since the camera space size should be getting smaller when it moves forward and vice versa.
For the last resort, currently i try to find the camera space size by myself, How do I implement this?
This is my projection matrix
Matrix4f projectionMatrix = new Matrix4f(-0.5f* currentCamWidth, 0.5f * currentCamWidth, -0.5f * currentCamHeight, 0.5f * currentCamHeight, -1f, node.getFullPosition().getZ());
Current cam width and current cam height are always constant. the coordinates are opengl coordinates