I found this thread discussing this question, and I noticed this set of postings:
lydesik:
my matrix are ROW_MAJOR here are my matrixes modelViewMatrix
0.998775 -0.007211 0.048951 0.000000
-0.006447 -0.999855 -0.015741 0.000000
0.049058 0.015406 -0.998677 0.000000
0.085168 -0.049039 1.303295 1.000000
inverseModelViewMatrix
0.998775 -0.007211 0.048951 -0.149216
-0.006447 -0.999855 -0.015741 -0.027968
0.049058 0.015406 -0.998677 1.298148
0.000000 0.000000 0.000000 1.000000
here is the code i'm using to print the matrix
void printMATRIX4X4(MATRIX4X4& matSrcMatrix) { MATRIX4X4* s = &matSrcMatrix; LOGI(
"%f %f %f %f",s->M(0,0), s->M(0,1), s->M(0,2), s->M(0,3));
LOGI("%f %f %f %f",s->M(1,0), s->M(1,1), s->M(1,2), s->M(1,3));
LOGI("%f %f %f %f",s->M(2,0), s->M(2,1), s->M(2,2), s->M(2,3));
LOGI("%f %f %f %f",s->M(3,0), s->M(3,1), s->M(3,2), s->M(3,3));
ksiva:
So if you look at your inverse modelview matrix, the 3rd column should be the camera lookAt and the 4th column should be the camera position. Pull those values out however you'd like! - Kim
In my application, I set the camera to the transpose of the projection and pose matrices every frame. This has been working for me, but in my game engine, the camera's position isn't updated when using matrices directly, so I need to be able to get the cameras position and orinetation/look at from these matrices. I tried setting the cameras position and look at with the 3rd and 4th columns of the inverse of the pose matrix, but that doesn't work as expected. Any help?
How to get camera position/orientation from pose matrix.
I also found this post, but my game engine doesn't have the API calls needed to set the up and right vectors for the camera.
How to get camera position/orientation from pose matrix.
Which game engine are you using?
How to get camera position/orientation from pose matrix.
I'm using gamekit, but to set the camera's custom view and projection matrices, I am calling down to Ogre.
How to get camera position/orientation from pose matrix.
Have you seen this project? - https://github.com/airgames/vuforia-gamekit-integration
How to get camera position/orientation from pose matrix.
Yeah, I used that project to figure out how to use the pose and projection matrices. The original source doesn't work correctly, though.
How to get camera position/orientation from pose matrix.
The render function is where the camera in gamekit is set, and here's my version with the relevant bits:
How to get camera position/orientation from pose matrix.
I noticed that the values for y seem to be reversed when using the method that gets the translation for the camera from the inverse of the model view matrix. When I move the physical camera up the y axis, the y values are getting lower.
How to get camera position/orientation from pose matrix.
See: https://developer.vuforia.com/resources/dev-guide/projection-matrix-explained
Based on the intrinsic camera calibration of the specific device (coming from the device profile) we create a GL projection matrix with the following coordinate frame:
How to get camera position/orientation from pose matrix.
Hi, I am having a similar problem. Did you manage to solve this problem and how?
I'm wondering maybe if I/we need to create our own projection matrix from the CameraDevice... not sure though.
How to get camera position/orientation from pose matrix.
Are these what you need?
https://developer.vuforia.com/library//articles/Solution/How-To-Use-the-Camera-Projection-Matrix
https://developer.vuforia.com/library//articles/Solution/Get-the-Camera-Position
How to get camera position/orientation from pose matrix.
Somebody please explain the derivation of the projection matrix. As @pbs123 has already said, the "projection matrix explained" link on David Beard's answer has been shaved.
How to get camera position/orientation from pose matrix.
How to get camera position/orientation from pose matrix.
Thanks but that didn't exactly help me right now.