Changes
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user