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
Why? Just because you move around the point of view that doesn't mean that the properties of the "virtual lens" change.
Why? That's not how cameras work.
It's really hard to give a helpful answer here, without seeing the code you've written so far. At the moment it's guesswork at best.