Log in or register to post comments

how do I get the view matrix?

April 1, 2012 - 12:51am #1

Forgive my bad English.
I already know the model view matrix, :confused:
Specifically how to calculate it, or ready-made method to get?
This question bothers me a long time

Re: how do I get the view matrix?

April 5, 2012 - 10:40pm #5

Thank you very much for your answer.Your answer is very useful for me

Re: how do I get the view matrix?

April 5, 2012 - 3:36pm #4

If you take the inverse of the modelview matrix you'll get a matrix that defines the position/orientation of the camera in relation to a target sitting at the world origin. The fourth column of the matrix is the position.

- Kim

Re: how do I get the view matrix?

April 4, 2012 - 8:16pm #3

I'm sorry, I still do not understand.I know how to obtain modelViewMatrix, but it is not I want the final data.
I want to know the coordinates of camera relative to the trackable. (When the position of the camera constant, regardless of how rotating equipment, the coordinates of this position is unchanged.)

Re: how do I get the view matrix?

April 2, 2012 - 7:57am #2

The pose returned by the trackable is the same thing as a view matrix:

QCAR::Matrix44F modelViewMatrix = QCAR::Tool::convertPose2GLMatrix(trackable->getPose());

The convertPose2GLMatrix just turns the 3x4 row-major pose matrix into a 4x4 col-major matrix.

Note this pose assumes a camera sitting at the origin, pointing in the positive Z direction with X to the right and Y down.

- Kim

Log in or register to post comments