I'm currently migrating from one 3d engine to another (not sure if this is relevant cocos3d -> cocos2d-x) and in my new engine, I'm experiencing incorrect target tracking of my 3d model. So I'm tracing the data through the relevant routines in each app to see what the differences are (I'm using the same cloud reco target for each app, on the same device and holding the device at a similar orientation to the target for both). Tracing it back to the very first few lines:
const QCAR::TrackableResult* result = state.getTrackableResult(i); const QCAR::Matrix34F& trackablePose = result->getPose(); QCAR::Matrix44F modelViewMatrix = QCAR::Tool::convertPose2GLMatrix(trackablePose);
I see there are differences right from the beginning - however I'm not sure why; or even if they are likely causes of my problem. Essentially I'm manipulating the modelViewMatrix to create a rotation quaternion and 3D position vectors for my 3D model; but the rotation and positioning aren't working correctly.
The pose is almost identical; all indices of the 12 float array have similar values; except for the last index which in the correct app version has a value, whereas in the in correct version has 0.
modelViewMatrix, on the other hand is much different between the two app versions. In the correct app version, all most all array indices contain a non-zero value except for indices 7,11, and 13 which are 0. However in the incorrect app version the modelViewMatrix only has 2 non-zero values at indices 0 and 12.
I would love some input here as to whether I'm barking up the wrong tree. It just seems if this is the basis of my quaternion calculations that it seems like a good place to start.