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 }
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?
Previously I used getProjectionGL using the camera calibration from Vuforia - this is important as Vuforia has all the information about camera, field of view etc.
= Martin =