Log in or register to post comments

Camera ModelView Matrix

October 11, 2018 - 6:04am #1

Hello there!

In my project I need to have access to the camera modelview matrix. I read some threads here but none of them gave a decisive answer.

Is it even possible to have access to the modelView matrix of the camera? And I don't mean the matrix that one can get from Unity camera attached to the ARCamera. It appears that in other SDKs (like c++, java in the following link ) this is possible via the the Tool namespace(https://library.vuforia.com/articles/Solution/Working-with-the-Camera), but not in Unity. If the answer is negative, how can I develop a plugin for Unity that simply returns the parameters I want? Just need a starting point.

Best regards

-Dana Scully

 

 

 

 

Camera ModelView Matrix

November 6, 2018 - 9:58am #6

Hello,

The model View matrix represents model to camera, i.e. it transforms a 3d point coordinates from the model reference frame to camera reference frame. A simple matrix inversion provides the opposite transformation.

Thanks,

Vuforia Engine Support

Camera ModelView Matrix

October 30, 2018 - 3:11am #5

Hello,

Thanks for the reply. The modelView matrix obtained from the multiplication appears to be correct. One last question: Which model view is represented? Is it the model in camera coordinate system or is it the camera in model coordinate system? (My world center mode is set to Device, So I assume it should be model in camera). 

Best regards

-Dana Scully

 

 

Camera ModelView Matrix

October 19, 2018 - 3:23pm #4

Hello,

The DigitalEyewearController API is general purpose. It works in mono and stereo.

Thanks,

Vuforia Engine Support

Camera ModelView Matrix

October 18, 2018 - 2:42am #3

Hello,

Thanks for the reply. Sorry but I forgot to mention that currently I am using a webcam. The DigitalEyeWearARController is used for HoloLens and Stereo cam devices. Is the solution in the answer also applicable to the CameraDevice or is it going to be different then?

Best regards

-Dana Scully

 

 

Camera ModelView Matrix

October 16, 2018 - 2:47pm #2

Hello,

In general, the modelview matrix is the matrix that transforms from local object space to camera space.

In Unity, you can do this in two steps: 

  1. Matrix4x4 objectToWorldMatrix = gameObject.transform.localToWorldMatrix;
  2. worldToCameraMatrix = Camera.worldToCameraMatrix;
  3. You obtain the final "objectToCamera" matrix (ile. the modelview matrix) by multiplying the two matrices

The Vuforia camera can be obtained via DigitalEyewearController.Instance.PrimaryCamera

Thanks,

Vuforia Engine Support

Log in or register to post comments