From d99a1a0c535dadceb44a7ca353126935f2a69b24 Mon Sep 17 00:00:00 2001 From: RemiIO Scarlet Date: Fri, 31 Jan 2025 16:50:58 +0800 Subject: [PATCH] fix(viewer): restore original camera orbit setting Revert camera orbit to use originalOrbit variable instead of hardcoded values --- src/components/ViewerPanel.tsx | 11 +++++++---- src/state/initial-state.ts | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/ViewerPanel.tsx b/src/components/ViewerPanel.tsx index e45d60d..00291ad 100644 --- a/src/components/ViewerPanel.tsx +++ b/src/components/ViewerPanel.tsx @@ -212,14 +212,18 @@ export default function ViewerPanel({ className, style }: { className?: string, position: 'absolute', width: '100%', height: '100%', + backgroundColor: '#888', }} - camera-orbit={originalOrbit} + camera-orbit="0.785rad 1.1rad 200%" interaction-prompt={interactionPrompt} environment-image="./skybox-lights.jpg" + exposure="1.8" + shadow-intensity="0.5" + shadow-softness="0.5" max-camera-orbit="auto 180deg 300%" min-camera-orbit="auto 0deg 160%" camera-target="0m 0m 0m" - field-of-view="90deg" + field-of-view="100deg" camera-controls ar ref={modelViewerRef} @@ -239,8 +243,7 @@ export default function ViewerPanel({ className, style }: { className?: string, width: '100px', }} loading="eager" - camera-orbit={originalOrbit} - // interpolation-decay="0" + camera-orbit="0.785rad 1.1rad 200%" environment-image="./skybox-lights.jpg" max-camera-orbit="auto 180deg auto" min-camera-orbit="auto 0deg auto" diff --git a/src/state/initial-state.ts b/src/state/initial-state.ts index 548c173..960c1d4 100644 --- a/src/state/initial-state.ts +++ b/src/state/initial-state.ts @@ -42,9 +42,9 @@ export function createInitialState(state: State | null, source?: {content?: stri view: { layout: { mode: 'multi', - editor: true, + editor: false, viewer: true, - customizer: false, + customizer: true, } as any, color: defaultModelColor,