Start a new topic

Get target transformation matrix with Native SDK

To whom it may concern,


We are currently developing an application with the native SDK which relies on the wikitude tracking algorithm. We are able to get the ViewMatrix provided by the getModelView method but it seems that the matrix is not a normalized transformation matrix.

@Override
public void update(RecognizedTarget[] recognizedTargets) {

    recognizedTargets[0].getModelView();
    recognizedTargets[0].getProjectionMatrix();

}

 Could you enlight us about how to get the rotation and the translation of a given target related to the camera as a normalized transformation matrix? Also, I would like to take this opportunity to ask you what is the main purpose of the projection matrix.


Yours sincelery,

Javier


Hi Javier,



what do you mean by not being a "normalized" transformation matrix? Our view matrix should be an affine transformation matrix just like any other.


The purpose of the projection matrix is to transform view space positions (3D) into screen space positions (2D) which can be displayed on a screen. You will find the exact same matrix concept in every other 3D rendering application.


How to use the matrices should be well documented in our sample app. You need to simply perform the following multiplication.


projection_matrix * view_matrix * model_matrix * vertex_position;



- Daniel

Hi Daniel,


Excuse me late reply. I think that last time I did not made myself clear enough. My point is that we want to know how can we get the transformation matrix of the detected features related to the camera. Do we use the modelView matrix? If not, how?


Many thanks in advance,

Javier

Hi Javier,



the model view matrix contains the transformation from the image/instant/object target to the camera. So, I guess, the answer is yes. The model view matrix is what you need to use. I'm still confused about what exactly you are trying to do, however. Is there something not working?



- Daniel


Hi Daniel,


We need the raw matrix rotation and the translation from the model to the camera to do further calculations with them. Since you mentioned that the view matrix "contains the transformation" we asume that more transformations have been applied to this matrix. If so, how can we retrieve the original information?


Javier

I see. Yes, there should be some scaling in there in addition to the rotation and translation. But that should not stop you from extracting what you need, I believe.


May I see the code you tried to decompose the matrix with?



- Daniel

Login or Signup to post a comment