3D engine that AI agents drive
JavaScript 3d3d-engineagentic-aiai-agentsblenderclaude-codegame-enginegaussian-splattinggltfjavascriptmcpmcp-servermodel-context-protocolpath-tracerpath-tracingpbrrenderingthreejs-alternativewebgl2webgpu
<!doctype html>
<html lang="en" data-theme="crucible">
<head>
<meta charset="UTF-8" /><script>try{var saved=localStorage.getItem("crucible-color");if(saved==="light"||saved==="dark")document.documentElement.dataset.color=saved}catch(error){}</script>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="The figure keeps its size while the room behind it changes shape." />
<link rel="canonical" href="https://crucible.codepawl.com/recipe-dolly-zoom.html" />
<title>Field of view: a dolly zoom from FOV 75 to FOV 20 · Crucible</title>
<link rel="icon" href="/favicon.svg?v=2" type="image/svg+xml" /><link rel="icon" href="/favicon.ico?v=2" sizes="48x48" /><link rel="apple-touch-icon" href="/apple-touch-icon.png" />
</head>
<body class="site recipes">
<a class="skip-link" href="#content">Skip to content</a>
<header class="navigation">
<a class="brand" href="/" aria-label="Crucible home">Crucible</a>
<nav aria-label="Library"><a href="/docs.html">Docs</a><a href="/recipes.html" aria-current="page">Recipes</a><a href="/marketplace.html">Marketplace</a><a href="/changelog.html">Changelog</a></nav>
<a class="site-nav-cta" href="https://github.com/codepawl/crucible" aria-label="GitHub"><span class="package-logo package-logo-github" aria-hidden="true"></span><span class="site-nav-cta-label">GitHub</span></a>
</header>
<main id="content">
<p class="recipe-back"><a href="/recipes.html"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="m15 6-6 6 6 6"/></svg>Recipes</a></p>
<h1>Field of view: a dolly zoom from FOV 75 to FOV 20</h1>
<video class="recipe-clip" src="/recipes/dolly-zoom.mp4" poster="/recipes/dolly-zoom-before.webp" width="960" height="540" muted loop playsinline autoplay aria-label="Field of view: a dolly zoom from FOV 75 to FOV 20, rendered by Crucible"></video>
<div class="recipe-pair"><figure><img src="/recipes/dolly-zoom-before.webp" width="960" height="540" alt="Field of view: a dolly zoom from FOV 75 to FOV 20: FOV 75" /><figcaption>FOV 75</figcaption></figure><figure><img src="/recipes/dolly-zoom-after.webp" width="960" height="540" alt="Field of view: a dolly zoom from FOV 75 to FOV 20: FOV 20" /><figcaption>FOV 20</figcaption></figure></div>
<div class="recipe-why"><p>A wide lens up close and a long lens far away frame the subject the same, but the background does not agree: the colonnade is stretched at FOV 75 and squeezed flat at FOV 20.</p><p>Two camera tracks do it. One animates the FOV. The other moves the camera back to distance 1.35 / tan(FOV / 2) from the figure, so the frame always covers 2.7 m at the figure and the figure keeps its size.</p></div>
<section class="recipe-code" aria-labelledby="scene-code-title">
<div class="recipe-code-heading"><h2 id="scene-code-title">Scene code</h2><button type="button" data-copy-code="scene-code">Copy</button></div>
<pre><code id="scene-code">{
"format": "crucible.scene",
"schemaVersion": 1,
"geometries": [
{ "id": "post", "type": "cylinder", "segments": 32 },
{ "id": "ball", "type": "sphere", "segments": 48, "rings": 32 },
{ "id": "floor", "type": "box", "bevel": 0 }
],
"materials": [
{ "id": "subject", "color": [0.9, 0.35, 0.12], "metallic": 0, "roughness": 0.45 },
{ "id": "stone", "color": [0.62, 0.6, 0.56], "metallic": 0, "roughness": 0.8 },
{ "id": "ground", "color": [0.3, 0.32, 0.34], "metallic": 0, "roughness": 0.9 }
],
"nodes": [
{ "id": "ground", "geometry": "floor", "material": "ground", "translation": [0, -0.05, -8], "scale": [14, 0.1, 30] },
{ "id": "figure-body", "geometry": "post", "material": "subject", "translation": [0, 0.55, 0], "scale": [0.28, 1.1, 0.28] },
{ "id": "figure-head", "geometry": "ball", "material": "subject", "translation": [0, 1.3, 0], "scale": [0.3, 0.3, 0.3] },
{ "id": "left-1", "geometry": "post", "material": "stone", "translation": [-2.2, 1.2, -2], "scale": [0.35, 2.4, 0.35] },
{ "id": "left-2", "geometry": "post", "material": "stone", "translation": [-2.2, 1.2, -5], "scale": [0.35, 2.4, 0.35] },
{ "id": "left-3", "geometry": "post", "material": "stone", "translation": [-2.2, 1.2, -8], "scale": [0.35, 2.4, 0.35] },
{ "id": "left-4", "geometry": "post", "material": "stone", "translation": [-2.2, 1.2, -11], "scale": [0.35, 2.4, 0.35] },
{ "id": "right-1", "geometry": "post", "material": "stone", "translation": [2.2, 1.2, -2], "scale": [0.35, 2.4, 0.35] },
{ "id": "right-2", "geometry": "post", "material": "stone", "translation": [2.2, 1.2, -5], "scale": [0.35, 2.4, 0.35] },
{ "id": "right-3", "geometry": "post", "material": "stone", "translation": [2.2, 1.2, -8], "scale": [0.35, 2.4, 0.35] },
{ "id": "right-4", "geometry": "post", "material": "stone", "translation": [2.2, 1.2, -11], "scale": [0.35, 2.4, 0.35] }
],
"camera": { "eye": [0, 0.8, 1.759],"target": [0, 0.8, 0], "fov": 75 },
"environment": { "world": true, "lightDirection": [-0.5, 1, 0.6], "keyIntensity": 1.6, "ambientIntensity": 0.5, "skyTop": [0.55, 0.7, 0.9], "skyBottom": [0.85, 0.88, 0.9] },
"motion": {
"duration": 4.8,
"loop": false,
"tracks": [
{
"kind": "camera", "property": "fov", "interpolation": "LINEAR",
"keyframes": [{ "time": 0, "value": 75 }, { "time": 0.4, "value": 70.42 }, { "time": 0.8, "value": 65.83 }, { "time": 1.2, "value": 61.25 }, { "time": 1.6, "value": 56.67 }, { "time": 2, "value": 52.08 }, { "time": 2.4, "value": 47.5 }, { "time": 2.8, "value": 42.92 }, { "time": 3.2, "value": 38.33 }, { "time": 3.6, "value": 33.75 }, { "time": 4, "value": 29.17 }, { "time": 4.4, "value": 24.58 }, { "time": 4.8, "value": 20 }]
},
{
"kind": "camera", "property": "eye", "interpolation": "LINEAR",
"keyframes": [{ "time": 0, "value": [0, 0.8, 1.759] }, { "time": 0.4, "value": [0, 0.8, 1.913] }, { "time": 0.8, "value": [0, 0.8, 2.086] }, { "time": 1.2, "value": [0, 0.8, 2.28] }, { "time": 1.6, "value": [0, 0.8, 2.504] }, { "time": 2, "value": [0, 0.8, 2.763] }, { "time": 2.4, "value": [0, 0.8, 3.068] }, { "time": 2.8, "value": [0, 0.8, 3.434] }, { "time": 3.2, "value": [0, 0.8, 3.884] }, { "time": 3.6, "value": [0, 0.8, 4.45] }, { "time": 4, "value": [0, 0.8, 5.188] }, { "time": 4.4, "value": [0, 0.8, 6.197] }, { "time": 4.8, "value": [0, 0.8, 7.656] }]
}
]
}
}</code></pre>
</section>
<p class="recipe-file"><a href="/recipes/dolly-zoom.json" download>Download dolly-zoom.json</a><span>Paste it into <code>scene_create</code> as <code>recipe</code>.</span></p>
</main>
<footer class="site-footer" aria-label="Site footer">
<p><a class="brand" href="/" aria-label="Crucible home">Crucible</a> by <a href="https://codepawl.com">CodePawl</a></p>
<nav class="footer-links" aria-label="Project links"><a href="https://github.com/codepawl/crucible"><span class="package-logo package-logo-github" aria-hidden="true"></span>GitHub</a><a href="https://www.npmjs.com/package/@codepawlhq/crucible"><span class="package-logo package-logo-npm" aria-hidden="true"></span>npm</a><a href="/changelog.md">Changelog</a><a href="/license.txt">MIT license</a></nav>
</footer>
<script type="module" src="/src/recipes.js"></script>
</body>
</html>