Confirm tilts

This commit is contained in:
2026-07-08 20:24:50 +10:00
parent 6692e739c6
commit 2660bb3517
2 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -97,6 +97,6 @@
} }
} }
</script> </script>
<script type="module" src="js/exhibit.js?v=1"></script> <script type="module" src="js/exhibit.js?v=2"></script>
</body> </body>
</html> </html>
+5 -4
View File
@@ -146,13 +146,14 @@
const pose = posit.pose(centredCorners(m, grab.width, grab.height)); const pose = posit.pose(centredCorners(m, grab.width, grab.height));
if (!pose) return null; if (!pose) return null;
const R = pose.bestRotation, t = pose.bestTranslation; const R = pose.bestRotation, t = pose.bestTranslation;
// NEW conversion (matches exhibit.js fix): rotation as-is, flip only
// translation Y and Z. Preserves correct orientation.
poseMatrix.set( poseMatrix.set(
R[0][0], R[0][1], R[0][2], t[0], R[0][0], R[0][1], R[0][2], t[0],
R[1][0], R[1][1], R[1][2], t[1], R[1][0], R[1][1], R[1][2], -t[1],
R[2][0], R[2][1], R[2][2], t[2], R[2][0], R[2][1], R[2][2], -t[2],
0, 0, 0, 1 0, 0, 0, 1
); );
poseMatrix.premultiply(flip); // F*M (ar-head convention)
anchor.matrix.copy(poseMatrix); anchor.matrix.copy(poseMatrix);
anchor.matrixWorldNeedsUpdate = true; anchor.matrixWorldNeedsUpdate = true;
@@ -258,7 +259,7 @@
function buildLog() { function buildLog() {
const L = []; const L = [];
L.push('=== NEWBURY ORIENTATION LOG ==='); L.push('=== NEWBURY ORIENTATION LOG ===');
L.push('conversion: F*M (premultiply flip) marker:' + MARKER_SIZE_MM + 'mm cam:' + grab.width + 'x' + grab.height); L.push('conversion: NEW (rotation as-is, flip translation Y/Z) marker:' + MARKER_SIZE_MM + 'mm cam:' + grab.width + 'x' + grab.height);
L.push('cols: t,id,dist, RAW(pitch,roll,yaw), RENDER(pitch,roll,yaw), GYRO(beta,gamma,alpha)'); L.push('cols: t,id,dist, RAW(pitch,roll,yaw), RENDER(pitch,roll,yaw), GYRO(beta,gamma,alpha)');
L.push('gyro beta=front/back tilt, gamma=left/right tilt, alpha=compass'); L.push('gyro beta=front/back tilt, gamma=left/right tilt, alpha=compass');
L.push('samples:' + log.length); L.push('samples:' + log.length);