fix: [rd] 3D 개폐 조절 시 카메라 시점 유지

- 셔터 개폐 슬라이더 조작 시 카메라 위치가 리셋되던 문제 수정
- 최초 빌드 시에만 카메라 초기화, 이후 재빌드에서는 현재 시점 유지
This commit is contained in:
김보곤
2026-03-08 21:11:52 +09:00
parent 4206111a13
commit 0f96834214

View File

@@ -965,6 +965,7 @@ function animate() {
ro.observe(container);
}
let fs3dCameraInit = false;
function fs3dBuild() {
if (!scene) return;
// Clear existing meshes
@@ -1195,10 +1196,13 @@ function fs3dBuild() {
meshes.wall.position.set(0, (H + b.height) / 2, -rd / 2 - 50);
scene.add(meshes.wall);
// Camera target
controls.target.set(0, H / 2, 0);
camera.position.set(W * 1.2, H * 0.8, W * 1.5);
controls.update();
// Camera: 최초 빌드 시에만 위치 설정, 이후 재빌드 시 현재 시점 유지
if (!fs3dCameraInit) {
controls.target.set(0, H / 2, 0);
camera.position.set(W * 1.2, H * 0.8, W * 1.5);
controls.update();
fs3dCameraInit = true;
}
}
// 3D Controls