From hyperframes
Adapts Three.js and WebGL for HyperFrames to render deterministic scenes, AnimationMixer timelines, camera motion, shader visuals, and canvas layers via hf-seek events.
npx claudepluginhub ilderaj/agent-plugin-marketplace --plugin codex--hyperframesThis skill uses the workspace's default tool permissions.
HyperFrames supports Three.js through its `three` runtime adapter. The adapter does not own your scene. It publishes HyperFrames time and dispatches a seek event so your composition can render the exact frame.
Adapts Web Animations API for HyperFrames to enable seekable element.animate() motions, currentTime seeking, document.getAnimations(), and deterministic native browser animations.
Builds interactive 3D web scenes with Three.js using WebGL/WebGPU. Guides on scenes, cameras, renderers, geometries, materials, meshes, lights, animations, and OrbitControls.
Animates Three.js scenes using keyframe tracks, AnimationMixer, clips, morph targets, blending, GLTF playback, and procedural motion.
Share bugs, ideas, or general feedback.
HyperFrames supports Three.js through its three runtime adapter. The adapter does not own your scene. It publishes HyperFrames time and dispatches a seek event so your composition can render the exact frame.
hf-seek event and render exactly that time.requestAnimationFrame or renderer.setAnimationLoop as the source of truth for render-critical motion.The adapter sets window.__hfThreeTime and dispatches new CustomEvent("hf-seek", { detail: { time } }) on each seek.
<canvas id="three-layer"></canvas>
<script type="module">
import * as THREE from "https://cdn.jsdelivr.net/npm/three@0.181.2/+esm";
const canvas = document.getElementById("three-layer");
const renderer = new THREE.WebGLRenderer({ canvas, alpha: true, antialias: true });
// Match these to your composition's frame size.
renderer.setSize(1920, 1080, false);
renderer.setPixelRatio(1);
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera(35, 1920 / 1080, 0.1, 100);
camera.position.set(0, 0, 6);
const mesh = new THREE.Mesh(
new THREE.IcosahedronGeometry(1.4, 4),
new THREE.MeshStandardMaterial({ color: 0x64d2ff, roughness: 0.38 }),
);
scene.add(mesh);
scene.add(new THREE.HemisphereLight(0xffffff, 0x223344, 2));
function renderAt(time) {
mesh.rotation.y = time * 0.7;
mesh.rotation.x = Math.sin(time * 0.6) * 0.16;
renderer.render(scene, camera);
}
window.addEventListener("hf-seek", (event) => {
renderAt(event.detail.time);
});
renderAt(window.__hfThreeTime || 0);
</script>
#three-layer {
width: 100%;
height: 100%;
display: block;
}
For GLTF or authored clip animation, seek the mixer directly:
function renderAt(time) {
mixer.setTime(time);
renderer.render(scene, camera);
}
If several mixers exist, seek all of them from the same time.
time.Date.now(), performance.now(), or clock deltas to update scene state.After editing a Three.js composition:
npx hyperframes lint
npx hyperframes validate
packages/core/src/runtime/adapters/three.ts.WebGLRenderer docs: https://threejs.org/docs/pages/WebGLRenderer.htmlAnimationMixer.setTime() docs: https://threejs.org/docs/pages/AnimationMixer.html