From e8d6a2f4b6c7c28c1739fb616444abed264c3620 Mon Sep 17 00:00:00 2001 From: jessikitty Date: Tue, 4 Aug 2026 11:33:50 +1000 Subject: [PATCH] Show inter-marker spread in dev HUD (updateDbg takes spread) --- public/js/exhibit.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/js/exhibit.js b/public/js/exhibit.js index c83069d..280cd82 100644 --- a/public/js/exhibit.js +++ b/public/js/exhibit.js @@ -43,7 +43,7 @@ let clockOffset = 0; // serverNow - clientNow const _dbgEuler = new THREE.Euler(); const _dbgV = new THREE.Vector3(); let dbgEl = null; -function updateDbg(fusedQuat, markerCount) { +function updateDbg(fusedQuat, markerCount, spread) { if (!dbgEl) return; const deg = r => (r * 180 / Math.PI).toFixed(0).padStart(4); // raw fused (CV-frame) orientation as YXZ euler @@ -53,9 +53,10 @@ function updateDbg(fusedQuat, markerCount) { const view = _dbgV.set(0, 0, -1).applyQuaternion(camera3.quaternion).clone(); const up = _dbgV.set(0, 1, 0).applyQuaternion(camera3.quaternion).clone(); const v3 = v => `(${v.x.toFixed(2)},${v.y.toFixed(2)},${v.z.toFixed(2)})`; + const spreadLine = markerCount > 1 ? ` spread ${spread.toFixed(1)}cm` : ''; dbgEl.textContent = `rot ${getRotMode()} cam ${camMode} (tap to cycle)\n` + - `markers ${markerCount}\n${rawLine}\nview ${v3(view)}\nup ${v3(up)}\n` + + `markers ${markerCount}${spreadLine}\n${rawLine}\nview ${v3(view)}\nup ${v3(up)}\n` + `pos ${v3(camera3.position)}`; } @@ -268,7 +269,7 @@ function loop(t) { // pose.js already conjugated rotation into the three.js frame; apply any // residual camera-frame correction (switchable via overlay) camera3.quaternion.copy(fused.quaternion).multiply(CAM_CORR[camMode]); - updateDbg(fused.quaternion, fused.markerCount); + updateDbg(fused.quaternion, fused.markerCount, fused.spread); } } }