This commit is contained in:
gpt-engineer-app[bot]
2026-02-27 01:00:36 +00:00
parent b8186e6677
commit 7554caa217
3 changed files with 133 additions and 1 deletions
+12 -1
View File
@@ -26,6 +26,7 @@ function GLBModel({ url }: { url: string }) {
const opacity = useModelStore((s) => s.opacity);
const renderMode = useModelStore((s) => s.renderMode);
const checklist = useModelStore((s) => s.checklist);
const fineTuning = useModelStore((s) => s.fineTuning);
const modelInfo = useMemo(() => {
const box = new THREE.Box3().setFromObject(scene);
@@ -71,8 +72,18 @@ function GLBModel({ url }: { url: string }) {
});
}, [scene, opacity, renderMode, checklist]);
const rotYRad = (fineTuning.rotY * Math.PI) / 180;
return (
<group ref={ref} position={[-modelInfo.center.x, -modelInfo.center.y, -modelInfo.center.z]}>
<group
ref={ref}
position={[
-modelInfo.center.x + fineTuning.posX,
-modelInfo.center.y + fineTuning.posY,
-modelInfo.center.z + fineTuning.posZ,
]}
rotation={[0, rotYRad, 0]}
>
<primitive object={scene} />
</group>
);