From 704b878691084e6f2db60534e9963b6087558abb Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sun, 24 May 2026 20:11:36 +0000 Subject: [PATCH] Changes Co-authored-by: Reifonas <211114984+Reifonas@users.noreply.github.com> --- src/components/three/ModelViewer.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/three/ModelViewer.tsx b/src/components/three/ModelViewer.tsx index bd176c3..dd655f4 100644 --- a/src/components/three/ModelViewer.tsx +++ b/src/components/three/ModelViewer.tsx @@ -239,17 +239,6 @@ function GLBModel({ sceneModel, isActive }: { sceneModel: SceneModel; isActive: const scaleRatio = useModelStore((st) => st.scaleRatio); const renderFactor = scaleRatio?.factor ?? 1; - if (!sceneModel.visible) return null; - if (!scene) return null; - - // Determine dominant local axis of the model (longest bbox side) for axial roll - const dominantAxis: 'x' | 'y' | 'z' = - modelInfo.size.x >= modelInfo.size.y && modelInfo.size.x >= modelInfo.size.z - ? 'x' - : modelInfo.size.y >= modelInfo.size.z - ? 'y' - : 'z'; - // Calibration quaternion (applied innermost, around center). We render with identity // while calibration is in progress for this model so face normals reflect the // un-calibrated frame; the result is committed at the end. @@ -262,6 +251,17 @@ function GLBModel({ sceneModel, isActive }: { sceneModel: SceneModel; isActive: }, [calQuatArr, isCalibratingThis]); const calGroupRef = useRef(null); + if (!sceneModel.visible) return null; + if (!scene) return null; + + // Determine dominant local axis of the model (longest bbox side) for axial roll + const dominantAxis: 'x' | 'y' | 'z' = + modelInfo.size.x >= modelInfo.size.y && modelInfo.size.x >= modelInfo.size.z + ? 'x' + : modelInfo.size.y >= modelInfo.size.z + ? 'y' + : 'z'; + return (