Three.js Scroll Origami Crane Unfold — Panel Hinge Fold Animation

Three.js Scroll Origami Crane Unfold · Scroll · Plain HTML, CSS & JS · Live preview

What's included

Features

Five flat triangular BufferGeometry panels, each pivoted via a THREE.Group positioned at its hinge line
Panel folds are pure rotation around a hinge axis (x, y, or z) — no skeletal rig or morph targets required
Each panel remaps the shared scrubbed progress into its own staggered local 0-1 window for sequential folding
Smoothstep easing applied per-panel on top of the staggered remap for an accelerate-and-settle fold feel
Two alternating warm paper-tone materials with DoubleSide rendering keep thin panels readable at any fold angle
Camera slowly dollies and arcs as the crane folds, ending on a three-quarter view of the finished form
Fully reversible pinned scroll animation — scrolling up unfolds every panel back to flat in reverse sequence
Zero per-frame geometry changes: only Group.rotation values are written, keeping the loop cheap regardless of panel count

About this UI Snippet

How to Build a Scroll-Driven Origami Crane Fold With Three.js

Screenshot of the Three.js Scroll Origami Crane Unfold snippet rendered live

The Three.js Scroll Origami Crane Unfold snippet builds a low-poly paper crane from a handful of flat triangular panels, each mounted on its own hinge pivot. As the visitor scrolls through a pinned stage, panels rotate around their hinge axes in a staggered sequence, folding a flat sheet-like arrangement into a recognizable crane silhouette.

Panels as pivoted Groups, not skinned meshes

Rather than using a skeletal rig or morph targets, each panel is a single flat THREE.BufferGeometry triangle whose local origin sits exactly at its hinge line. That geometry is added to a THREE.Group positioned at the panel's hinge point in the overall sheet layout. Rotating the group's rotation.x, .y, or .z folds the flat panel up out of the sheet plane around that hinge, the same lightweight pivot-group trick used any time a hinge needs to rotate a flat surface without a skeletal rig, applied here to build a full multi-panel form instead of a single flip.

Five panels approximate wing, neck, and tail folds

A real crane fold involves dozens of creases, but a low-poly reading only needs a handful of large panels: a static body base, two wing panels folding outward and back, a neck/head panel folding up and forward, and a tail panel folding down and back. Each panel definition carries a fold axis (x, y, or z) and a target angle in radians, so the whole crane's final pose is fully described by five small objects rather than a mesh-editing tool export.

Staggered per-panel progress from one scrubbed value

Instead of animating all five panels in lockstep, each panel remaps the single scrubbed eased progress into its own local 0-1 window via (eased - start) / span, clamped and re-smoothstepped. Earlier panels (like the wings) get an earlier window than later ones (like the neck), so panels visibly fold in sequence rather than simultaneously — closer to how a person actually folds paper, one crease at a time, and comparable to the staggered reveal timing in scroll sticky stack.

Reversible because every fold is angle times progress

Every panel's live rotation is its fixed target angle multiplied by its own local eased progress, so there is no accumulated state anywhere — setting the input progress back to zero exactly unfolds every panel back to flat, in the same staggered order reversed. Scrolling up therefore always retraces the fold exactly, panel by panel.

Warm parchment palette with soft directional lighting

Two paper-tone MeshStandardMaterials (warm cream and a slightly deeper tan) alternate across panels so adjacent folds read as distinct facets, and side: THREE.DoubleSide keeps the thin triangles visible from both sides as they rotate through extreme angles. A single warm directional light plus a soft point fill light gives the flat paper geometry enough shading to read as folded 3D form without needing high-poly geometry.

Build with AI

Build, Understand, Optimize, and Extend It With AI

You do not need to reverse-engineer how a flat sheet of paper panels folds into a recognizable crane using only rotation values. Paste this snippet's HTML, CSS, and JS into an AI assistant like Claude and ask it to explain why pivot Groups are used instead of a skeletal rig, or how the per-panel staggered progress remap produces a one-crease-at-a-time fold from a single scrubbed value. The same assistant can help you extend it — ask it to add more panels for finer creases, add a subtle paper-texture normal map, or generalize panelDefs into a small JSON format so other origami shapes (boat, box, star) can be described the same way. Treat the code as a conversation starter, not a finished artifact.

Prompt to recreate it

Copy this into your AI assistant of choice to build the effect from scratch, or as a jumping-off point for your own variant:

text
Build a "scroll-scrubbed origami crane fold" in plain HTML, CSS, and JavaScript using Three.js, GSAP, and GSAP's ScrollTrigger plugin, all loaded from a CDN (no bundler, no build step).

Requirements:
- A pinned section containing a full-size canvas, with a WebGLRenderer and PerspectiveCamera sized to the canvas element (not window.innerWidth/innerHeight) and updated on window resize including aspect ratio.
- Model roughly five flat triangular paper panels using THREE.BufferGeometry, each built in local space so its hinge edge sits at the geometry's local origin.
- Wrap each panel mesh in its own THREE.Group positioned at that panel's hinge point relative to a shared flat layout, so rotating group.rotation around a chosen axis (x, y, or z) folds the panel around its hinge line without any skinning or bones.
- Define each panel's fold as a target rotation axis and target angle in radians representing a fully folded pose (e.g. wing panels folding outward and back, a neck panel folding up, a tail panel folding down).
- Use two alternating warm paper-tone MeshStandardMaterials with side: THREE.DoubleSide so thin panels stay visible from both sides through extreme fold angles.
- Register a GSAP tween on a ScrollTrigger targeting the pinned section, with pin: true, start at top top, a numeric scrub, and a multi-hundred-percent end, animating a single plain progress value from 0 to 1 with linear easing.
- Every animation frame, apply smoothstep easing to the scrubbed progress, then for each panel remap that eased progress into its own local 0-1 window (via a per-panel start offset and span, clamped and re-smoothstepped) so panels visibly fold in a staggered one-at-a-time sequence rather than simultaneously, and set each panel group's rotation to its target angle times its own local eased value.
- Slowly rotate and reposition the whole crane group and arc the camera as the fold progresses, ending on a clear three-quarter view of the finished crane.
- Confirm scrolling back up reverses the entire fold smoothly, unfolding panels back to flat in the same staggered order reversed, since every rotation is a fixed angle times a progress value with no accumulated state.

Want to tighten it up first? Run this prompt through the AI Prompt Studio to score it across 8 quality dimensions, catch anti-patterns, and tune the wording for Claude, ChatGPT, or Gemini before you paste it in.

Source Code

<section class="ogc-stage" id="ogcStage">
  <div class="ogc-intro-overlay"><p>Scroll ↓ to fold the flat sheet into a paper crane</p></div>
  <canvas id="ogcCanvas"></canvas>
  <div class="ogc-hud"><span id="ogcPct">0</span>% folded</div>
</section>
<section class="ogc-bottom"><p>A fully folded low-poly paper crane.</p></section>

Step by step

How to Use

  1. 1
    Load all three CDN scriptsAdd three.min.js, gsap.min.js, and ScrollTrigger.min.js from the CDN panel, in that order.
  2. 2
    Paste HTML, CSS, and JSA flat arrangement of paper panels appears inside a pinned 3D stage with a live "% folded" read-out.
  3. 3
    Scroll downWing, neck, and tail panels fold in a staggered sequence into a low-poly crane silhouette.
  4. 4
    Scroll back upThe crane unfolds back to a flat sheet exactly in reverse, panel by panel, since every rotation is angle times progress.
  5. 5
    Retune the foldEdit panelDefs to change hinge positions, fold axes, or target angles for a different final silhouette.
  6. 6
    Adjust the pacingChange each panel's start/span window or the ScrollTrigger end value (+=450%) to retime the staggered fold.

Real-world uses

Common Use Cases

Paper craft and design portfolios
Show off origami, paper-craft, or product-packaging work with a piece that folds itself as the visitor scrolls.
Stationery and gift brand landing pages
A folding paper crane suits greeting-card, stationery, or handmade-gift storefronts better than a static hero.
Teaching hinge-based rigging
A compact, readable example of pivot Groups as a lightweight alternative to skeletal animation for flat-panel folds.
Scroll-story chapter breaks
Use the fold as a mid-page transition, similar in spirit to the scroll tunnel bridge between sections.
Wedding and event microsites
A crane fold reads well as a symbolic, celebratory reveal moment for invitation or save-the-date pages.
Puzzle game intros
Pair with paper plane flight for a shared paper-craft visual language across a game's loading or menu screens.

Got questions?

Frequently Asked Questions

A skeletal rig with bone weights is built for smoothly deforming continuous surfaces, which is overkill for flat rigid paper panels that only need to rotate around a straight hinge line. Positioning a THREE.Group at the hinge and adding the panel mesh as its child means rotating the group's rotation.x/y/z folds the panel exactly around that line with no skinning, weight painting, or animation clip export required.

Each panel remaps the single shared scrubbed progress value into its own local window via (eased - start) / span, clamped to 0-1 and re-smoothstepped. Giving wing panels an earlier start than the neck panel means the wings are mostly folded before the neck begins moving, producing a visible one-crease-at-a-time sequence from one underlying progress driver.

Yes. Every panel's rotation is computed as its fixed target angle multiplied by its own local eased progress, with no accumulation or hidden state. Driving the shared progress value back toward zero recomputes every panel's rotation back toward zero in the same staggered order, so the crane visibly unfolds panel by panel in reverse.

A flat single-triangle panel has zero thickness, so as it rotates through steep hinge angles the camera will see its back face at some point during the fold. THREE.DoubleSide on the MeshStandardMaterial ensures the panel keeps rendering correctly from both sides rather than disappearing when it turns edge-on or beyond.

Yes. Click JSX for a React component, Vue for a Vue 3 SFC, Angular for a standalone component, or Tailwind for a React + Tailwind version. Build the panel geometries, pivot groups, and GSAP ScrollTrigger inside a mount effect keyed to a canvas ref, and on unmount kill the ScrollTrigger instance, dispose geometries/materials, and call renderer.dispose().