# scroll-driven-camera

Drive a three.js camera along a spline from page scroll (one stop per section) with eased damping and a static frame under reduced motion

- **Space:** threejs-public (https://github.com/Tech-Realm/space-threejs-public/tree/main/scroll-driven-camera)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3, playwright-python, chromium
- **Routes:** static-local; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use threejs-public/scroll-driven-camera` or MCP `get_pack threejs-public/scroll-driven-camera`
- **Files:** CHANGELOG.md, code/boot.js, code/index.html, code/main.js, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/scroll.json, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal
Scroll position maps to a camera path through a 3D scene behind normal HTML sections; smooth, reversible, accessible.

## Steps
1. Copy `code/`; edit `STOPS` (camera position + look-at per section).
2. The canvas is fixed behind the content; sections stay real HTML (SEO, a11y).
3. Progress = scrollY / (scrollHeight - innerHeight), damped each frame.
4. Check scroll moves the camera: `python3 ../tools/webgl_check.py code --steps outcome/fixtures/scroll.json`.

## Edge cases
- iOS address-bar resize changes innerHeight: use the template's resize debounce.
- prefers-reduced-motion: jump between stops without easing.

## Don'ts
- Don't hijack scroll (no preventDefault on wheel).
- Don't put text into the canvas; keep it in HTML.



---

Canonical URL: https://logicpacks.io/packs/threejs-public/scroll-driven-camera

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
