PDA

View Full Version : How to interpret matrix values??


yarniso
August 18th, 2005, 06:28 PM
Hi all,

probably a simple question for you guys. I have set the tracker up and everything runs fine. However, the matrix (or at least the values I see) doesn't seem to be quite right. When I hold my camera almost straight above the marker (imagine the marker laying down on a table) I get the following values:

eye : (2.37821 , -10.9967 , 1091.38)
center: (2.45599 , -11.0202 , 1092.38)
up : (-0.102153 , -0.994649 , -.00154012)

(these values are obtainted using OpenSceneGraph's getLookAt function for matrices)

Now, there is this line in ar.h saying "..., and z axis is pointing downwards from marker plane." at arGetTransMat. What does this mean? That positive z-values are down (below the marker) or that they are up (above the marker)? And what about the values that I'm getting. The eye-point seems to be lower than the center. Which is odd, because I'm holding it above the marker....

Can anyone give me any explanation on this topic? And if you don't understand what I'm asking, please say so and I'll try to clarify things.

Kind regards

Graham
September 10th, 2005, 01:02 PM
I don't know if this will help or not, however:

The matrix the AR toolkit gives you is a matrix representing the marker in world space, given that the camera is an identity matrix. Ie, in direct3D speak, the view matrix is identity. If you wanted to treat a marker as a camera, then you would need to use the inverse of it's matrix, but I can't really see many situations you would want to do this.

So the camera, or eye position, should always be 0,0,0. In which case those values don't really look too bad?

does the 'getLookAt' function convert back from a matrix into those values? if so, then the values won't be accurate anyway...

J.Sch?ning
September 28th, 2005, 06:46 PM
I have nearly the same problem:

I read out the transformation matrix just with:
printf("%f %f %f %f %f \n %f %f %f %f %f \n%f %f %f %f %f \n
%f %f %f %f %f \n \n \n ",
gPatt_trans[0][0], gPatt_trans[0][1], gPatt_trans[0][2],gPatt_trans[0][3],gPatt_trans[0][4],
gPatt_trans[1][0], gPatt_trans[1][1], gPatt_trans[1][2],gPatt_trans[1][3],gPatt_trans[1][4],
gPatt_trans[2][0], gPatt_trans[2][1], gPatt_trans[2][2],gPatt_trans[2][3],gPatt_trans[2][4],
gPatt_trans[3][0], gPatt_trans[3][1], gPatt_trans[3][2],gPatt_trans[3][3],gPatt_trans[3][4]);


How can I interpret these values?
for example:

0.999649 0.023417 -0.012421 29.073109 0.021972
0.021972 -0.994130 -0.105941 -85.284767 -0.014829
-0.014829 0.105630 -0.994295 399.307214 0.000000
0.000000 350.475735 0.000000 158.250000 0.000000


Thx,

philip_lamb
September 28th, 2005, 10:37 PM
OK, first up, gPatt_trans has only 12 elements. But it looks like you are trying to print at least 20.

My suggestion is to first convert gPatt_trans into a standard OpenGL 4x4 column-major HCT matrix, like this:
GLdouble m[16];
scaleFactor = 1.0;
arglCameraView(gPatt_trans, m, scaleFactor);
Remember that OpenGL HCT matrices are COLUMN major, i.e. m[0] is the element from row 1 column 1, m[1] is the element from row 2 column 1, etc.

J.Sch?ning
October 9th, 2005, 11:11 PM
thx a lot!