From cb88c847771e2fbe00d5a8cd992c9a465e7a63e5 Mon Sep 17 00:00:00 2001 From: Quinta0 <0pietroquintavalle0@gmail.com> Date: Wed, 16 Sep 2026 00:04:23 +0200 Subject: [PATCH] aspect ratioed --- src/scene/ParticleScene.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/scene/ParticleScene.tsx b/src/scene/ParticleScene.tsx index b5ad8e1..150222e 100644 --- a/src/scene/ParticleScene.tsx +++ b/src/scene/ParticleScene.tsx @@ -62,8 +62,13 @@ export default function ParticleScene({ keyframes, onLabel, onProgress }: Props) const resize = () => { renderer.setPixelRatio(Math.min(devicePixelRatio, 2)) renderer.setSize(innerWidth, innerHeight, false) - camera.aspect = innerWidth / innerHeight; camera.updateProjectionMatrix() - camera.position.z = innerWidth < 760 ? 26 : 18 + const aspect = innerWidth / innerHeight + camera.aspect = aspect; camera.updateProjectionMatrix() + // fixed vertical FOV means horizontal FOV shrinks on portrait screens; back the + // camera off enough that the widest shape (the "PQ" text sweep, ~8 units half-width) + // still fits the frustum instead of getting cropped on narrow viewports + const halfV = Math.tan(camera.fov * Math.PI / 360) + camera.position.z = 8.2 / (halfV * Math.min(aspect, 1)) } // scroll: real fraction for the bar, section-keyed progress for the morph