"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Projection Matrix difference in V8 vs V6

Hi, I'm belatedly upgrading my app framework to Vuforia 8 from Vuforia 6. I have successfully got the tracked objects placed where they appear with V6, but when not tracking I'm getting a different projection matrix between the versions, so my non-tracked objects are placed differently.:

The code is given below, and called at screen re-orientation. 

// Cache the projection matrix:

#ifdef VUFORIA_V8
        Vuforia::TrackerManager& trackerManager = Vuforia::TrackerManager::getInstance();
        const Vuforia::State state = trackerManager.getStateUpdater().updateState();
        Vuforia::RenderingPrimitives *renderingPrimitives = new Vuforia::RenderingPrimitives(Vuforia::Device::getInstance().getRenderingPrimitives());
        Vuforia::Matrix34F projMatrix = renderingPrimitives->getProjectionMatrix(Vuforia::VIEW::VIEW_SINGULAR, state.getCameraCalibration());
        qUtils.projectionMatrix = Vuforia::Tool::convertPerspectiveProjection2GLMatrix(projMatrix,1.0f,2500.0f);
#else

        const QCAR::CameraCalibration& cameraCalibration = QCAR::CameraDevice::getInstance().getCameraCalibration();
        qUtils.projectionMatrix = QCAR::Tool::getProjectionGL(cameraCalibration, 1.0f, 2500.0f);
#endif

For V6 I get:

data = {
      [0] = 0
      [1] = -1.86011815
      [2] = 0
      [3] = 0
      [4] = -3.30687666
      [5] = 0
      [6] = 0
      [7] = 0
      [8] = 0
      [9] = -0.00156250002
      [10] = 1.00080037
      [11] = 1
      [12] = 0
      [13] = 0
      [14] = -2.00080037
      [15] = 0
    }

And for V8:

{
    [0] = 0
    [1] = -1.45888376
    [2] = 0
    [3] = 0
    [4] = 2.59219289
    [5] = 0
    [6] = 0
    [7] = 0
    [8] = -0.033016853
    [9] = 0.00614670897
    [10] = -1.00080037
    [11] = -1
    [12] = 0
    [13] = 0
    [14] = -2.00080037
    [15] = 0
  }

 

Hello,

In Vuforia Engine SDK 7.2, we introduced a new coordinate system. Please review the following article: https://library.vuforia.com/content/vuforia-library/en/articles/Solution/how-migrate-vuforia-7_2.html

Thanks,

Vuforia Engine Support

Hi medabit. Yes I've seen that, but isn't the projection matrix independent of this? In this instance I'm drawing objects relative to the screen, completely independent of Vuforia, but I wanted Vuforia to provide the projection Matrix for the camera/screen view, as it did in Vuforia 6.

Hello,

Thanks for the clarification. I've escalated to the dev team for a response.

Thanks,

Vuforia Engine Support

Hello,

Per the development team, changing the camera's coordinate systems also means changing the default direction of the camera (where it looks like/point to/forward vector). If that is changed, it means you also need to change the projection matrix.

Thanks,

Hi medabit, not sure if I follow this wrt what I'm asking. Let me ask the question a different way.

How would one now go about getting the projection matrix for objects in the camera's space, so objects can be drawn within the view, attached to the camera?