Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions WebARKit/WebARKitPattern.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,18 @@ void WebARKitPatternTrackingInfo::getTrackablePose(cv::Mat& pose) {

void WebARKitPatternTrackingInfo::updateTrackable() {
if (transMat) {
//visible = true;
// Keep `trans` as the raw OpenCV pose (rotation unmodified, translation
// scaled). The CV->GL handedness conversion (negate Y and Z rows incl.
// translation) is applied downstream by arglCameraViewRHf when building
// the GL right-handed modelview (matrixGL_RH / getGLViewMatrix).
// Previously, rotation columns 1 and 2 were negated here but the
// translation was not, producing an inconsistent partial conversion
// that left tracked objects behind the camera in OpenGL renderers.
for (int j = 0; j < 3; j++) {
trans[j][0] = transMat[j][0];
trans[j][1] = -transMat[j][1];
trans[j][2] = -transMat[j][2];
trans[j][3] = (transMat[j][3] * m_scale * 0.001f * 1.64f );
trans[j][0] = transMat[j][0];
trans[j][1] = transMat[j][1];
trans[j][2] = transMat[j][2];
trans[j][3] = (transMat[j][3] * m_scale * 0.001f * 1.64f);
}
}
}
Expand Down