posecode-render
v0.2.2
Published
Render a Posecode IR as an animated 3D human figure (skinned character or procedural mannequin) with Three.js.
Maintainers
Readme
posecode-render
Renders a posecode-parser IR
as an animated 3D human figure with Three.js:
forward kinematics plus ground-lock CCD IK, live in the browser at 60fps.
Pass characterUrl to show a realistic skinned character (any Mixamo-rigged
GLB); without it — or while it loads, or if it fails — a procedural athletic
figure renders instead, so the scene is never blank. Either way, a capsule
self-collision pass keeps limbs from passing through the body.
Part of Posecode: a kinematic-motion protocol LLMs can write, rendered as text-to-motion 3D animation.
Install
npm install posecode-render posecode-parser threeUsage
import { parse } from "posecode-parser";
import { createViewer } from "posecode-render";
const canvas = document.querySelector("canvas")!;
const viewer = createViewer(canvas, {
autoRotate: false,
// Optional: realistic skinned character (Mixamo bone naming). Omit for the
// zero-asset procedural figure.
characterUrl: "https://posecode.org/models/character.glb",
});
const { ir } = parse(myPosecodeSource);
if (ir) {
viewer.load(ir);
viewer.setLoop(true);
viewer.play();
}
viewer.onPhase(({ phaseName, cue }) => {
console.log(phaseName, cue);
});No GPU, no diffusion model: generation is a fraction of a cent of text, and rendering is plain forward kinematics.
License
Apache-2.0
