threejs-camera-direction
Skill1.1k starsChanged 4 days agoMITView on GitHub
Direct advanced Three.js camera systems and solve reference-matched lenses. Use for pinhole camera solving (FOV, pitch, roll, eye height, back-projected landmarks, real-world scale cues), keeping worlds level and true-shaped, scale-aware chase rigs, thrust lag, side/orbit cameras, body-relative up vectors, quaternion handoffs, authored cinematic framing, floating origins, pointer-look controls, camera collision constraints, projection ownership, and lifecycle restoration.
2 other projects use a version of this, 2 of them edited.
Adopted by
Most recently taken up by
- swyxio/skillsedited, first seen Nov 29, 2026
- jorgeasaurus/agent-skillsedited, first seen May 11, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 2
- swyxio/skills★ 20388% same
- jorgeasaurus/agent-skills★ 1488% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- .codex/AGENTS.mdAGENTS.md
- .claude/CLAUDE.mdCLAUDE.md
- threejs-atmosphere-aerial-perspectiveSkill
- threejs-bloomSkill
- threejs-exposure-color-gradingSkill
- threejs-image-pipelineSkill
- threejs-lighting-and-giSkill
- threejs-parallax-occlusion-mappingSkill
- threejs-precipitation-surfacesSkill
- threejs-procedural-animationSkill
- threejs-procedural-architectureSkill
- threejs-procedural-fieldsSkill
- threejs-procedural-geometrySkill
- threejs-procedural-materialsSkill
- threejs-procedural-planetsSkill
- threejs-procedural-vegetationSkill
- threejs-procedural-vfxSkill
- threejs-raymarched-space-effectsSkill
- threejs-reference-readingSkill
- threejs-screen-space-ambient-occlusionSkill
- threejs-shadow-systemsSkill
- threejs-skill-routerSkill
- threejs-spectral-oceanSkill
- threejs-temporal-stabilitySkill
- threejs-temporal-surfacesSkill
- threejs-terrain-and-landscapesSkill
- threejs-visual-validationSkill
- threejs-volumetric-cloudsSkill
- threejs-water-opticsSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Treat the camera as an authored visual system, not a passive viewport.
- Distinctive: line 20
Add input orbit/look only inside declared yaw/pitch and spatial constraints.
- Distinctive: line 21
Add frame-rate-independent follow or a bounded spring where the reference uses inertia.
- Distinctive: line 24
Test mode transitions, cuts, pointer-lock reacquisition, resize, and large coordinates.
- Distinctive: line 39
Use subject dimensions or solved real-world scale cues to derive distances.
- Distinctive: line 46
Update the projection matrix whenever FOV, near, far, or aspect changes.
- Distinctive: line 47
Keep stars or infinite backgrounds camera-relative when large translation would create false parallax or precision loss.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Camera Direction
Treat the camera as an authored visual system, not a passive viewport. Compose the subject, solve or establish true scale, choose a stable up frame, and make every mode handoff explicit.
Build order
- Define the design frame: subject size, screen occupancy, lens, near/far,
motion, and horizon/up convention — or solve FOV, pitch, roll, eye height,
and landmark coordinates numerically from image cues (
scripts/camera-solve.mjs). - Build camera targets in semantic frames: ship, body surface, docking axis, or scene-authored shot.
- Derive position and orientation independently, then combine them once.
- Add input orbit/look only inside declared yaw/pitch and spatial constraints.
- Add frame-rate-independent follow or a bounded spring where the reference uses inertia.
- Snapshot and restore camera projection/state when a scene owns it.
- Test mode transitions, cuts, pointer-lock reacquisition, resize, and large coordinates.
Read references/camera-rig-and-cinematic-systems.md for exact chase/side/orbit rigs, projection values, transition rules, floating-origin shot, pointer controls, and implementation limits.
Read references/camera-solve-and-real-scale.md
(and run scripts/camera-solve.mjs) for pinhole lens
solving from horizon/height/vertical/vanishing-point cues, normal-lens defaults
(35–55 mm eq), back-projected landmark tables, level/true-shape discipline,
and real-world scale cues.
Non-negotiable rules
- Use subject dimensions or solved real-world scale cues to derive distances; do not guess wide-angle FOVs that cramp spaces or bend world geometry to fit one frame.
- Lock the solved hero FOV instead of letting lens focal length drift across iterations.
- For planetary motion, derive up from the dominant body rather than global Y.
- Interpolate position with
lerpand orientation withslerp. - During an explicit handoff, use one interpolation stage. Do not stack a transition blend and a second follow smoother over the same interval.
- Re-sync yaw/pitch from the camera when pointer lock is acquired.
- Update the projection matrix whenever FOV, near, far, or aspect changes.
- Keep stars or infinite backgrounds camera-relative when large translation would create false parallax or precision loss.
- Restore camera and input ownership on scene disposal.
Routing boundary
Use $threejs-reference-reading to decode physical identities and scale cues from a visual reference before solving camera parameters. Use $threejs-procedural-animation for object motion timelines, springs, docking, staging, and debris. This skill owns lens solving, back-projected layout framing, how the scene is viewed, and how camera modes hand off.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

