Skip to content

Commit 8b0479d

Browse files
committed
improve ligting
1 parent 52f3d02 commit 8b0479d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/lib/components/Gallery3DCard.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
camera.position.z = 3.5;
3838
3939
// Lighting
40-
const ambient = new THREE.AmbientLight(0xfff1de, 0.08);
40+
const ambient = new THREE.AmbientLight(0xfff1de, 0.05);
4141
scene.add(ambient);
4242
4343
const keyLight = new THREE.DirectionalLight(0xffe5c8, 6.8);
44-
keyLight.position.set(4.2, 5.8, -1.2);
44+
keyLight.position.set(4.2, 7.8, -2);
4545
keyLight.castShadow = true;
4646
keyLight.shadow.mapSize.set(isMobile ? 1024 : 2048, isMobile ? 1024 : 2048);
4747
keyLight.shadow.camera.near = 0.5;
@@ -54,8 +54,8 @@
5454
keyLight.shadow.normalBias = 0.03;
5555
scene.add(keyLight);
5656
57-
const rimLight = new THREE.DirectionalLight(0xc8dcff, 1);
58-
rimLight.position.set(-4.5, 2.4, -5.2);
57+
const rimLight = new THREE.DirectionalLight(0x407ce3, 3);
58+
rimLight.position.set(-4.5, 2.4, -3.2);
5959
scene.add(rimLight);
6060
6161
// Pivot group for rotation
@@ -697,7 +697,7 @@
697697
const screenTop = projectToScreen(dimDef.top, cw, ch);
698698
const screenBot = projectToScreen(dimDef.bottom, cw, ch);
699699
700-
const dimOffset = -56;
700+
const dimOffset = -86;
701701
const dx = Math.min(screenTop.x, screenBot.x) + dimOffset;
702702
const tickLen = 8;
703703
@@ -721,7 +721,7 @@
721721
const midY = (screenTop.y + screenBot.y) / 2;
722722
dimLabel.style.opacity = dimFadeIn;
723723
dimLabel.textContent = '18.9 cm';
724-
dimLabel.style.transform = `translate(${dx - 6}px, ${midY}px) translate(-100%, -50%) rotate(-90deg)`;
724+
dimLabel.style.transform = `translate(${dx }px, ${midY}px) translate(-100%, -50%) rotate(-90deg)`;
725725
}
726726
}
727727

0 commit comments

Comments
 (0)