Skip to documentation

Skeleton Demo

Skeleton Demo is a camera-based geometry prototype. It displays landmarks for two hands and lets a learner select, rotate and resize a cube or square pyramid. Gestures are not graded. An optional local comparison panel measures pose similarity; it does not establish recognition accuracy.

The camera images, landmark positions, figure state, templates and comparison scores stay in browser memory. Continue saves ordinary lesson progression only. Use this page to try the demonstration, author a demo unit, or understand the prototype's measurement and implementation limits.

Try the demonstration

Use HTTPS or localhost with a supported camera. Choose Start camera, grant camera permission, and keep your hands in view. Each detected hand has 21 landmarks covering all five fingers. The display draws hand landmarks and connections; it does not draw a full-body wireframe.

Select Cube or Pyramid in the left palette. You can click, touch or use the keyboard, or place the midpoint of your thumb and index fingertips inside a figure button and pinch. Selection is immediate: you need no opening gesture or dwell time. A held pinch can move between buttons to switch figures, and a three-finger pinch also selects inside the palette. Middle-finger visibility does not affect selection. Either valid hand can select, even when left/right classification is uncertain; selection transfers control and establishes a fresh movement reference.

Outside the palette, turn your palm to rotate the figure. No fingertip pose is required. To resize, bring your thumb, index and middle fingertips together, then move upward to enlarge the figure or downward to shrink it. A quarter of the preview height doubles or halves its edge length, within 0.25–4 units. Resizing preserves rotation. Palette selection takes priority inside the buttons; triple-pinch resizing takes priority over rotation elsewhere.

Slow motion moves the figure. Fast motion is ignored, and the next slower increment resumes immediately without replaying the skipped motion or requiring a hold-still period. Lowering the hand quickly disengages through screen movement. Each figure remembers its size and orientation while you remain in the unit. The status area explains missing or uncertain tracking, pinch distance and targeting.

Camera and display controls

Camera and Wireframe independently hide the live video and the hand overlay. Both start On; the geometry and palette remain visible in all four combinations. Hiding a layer keeps capture and gesture tracking active. Use Stop camera to release the camera. Visibility choices survive camera restarts and switches within the mounted unit, and reset when entering another demo unit. The buttons support keyboard operation and announce their pressed state.

Start camera requests a user-facing camera and can use a desktop webcam without front/rear metadata. Switch camera appears after capture starts when the browser exposes multiple cameras. It releases the current stream before opening the selected device. If switching fails, choose Start camera to reopen the ordinary camera choice. Front/webcam views are mirrored. The app leaves a camera identified as rear-facing unmirrored.

Capture requires browser support for camera capabilities, track constraints, and the native resizeMode: none request. It prefers the device's reported maximum width and height. The preview fits the remaining viewport and preserves the delivered aspect ratio without cropping. Hardware and drivers determine the available modes. Check permissions or try another supported device if the app reports that the camera is unavailable. The toolbar displays the capture status and privacy note. The theme controls the display and its labels. Hand lines appear above the translucent palette.

Leaving the unit, hiding the tab or leaving the page stops camera capture and inference. Return and choose Start camera to resume. Stop, switch and hide clear gesture acquisition while retaining the mounted unit's figure orientations and lengths. Leaving the unit discards those values. Continue releases the camera and advances the lesson.

Figure geometry

Both choices are labeled wireframes with solid visible edges, hidden edges dashed at 30% opacity, midpoint equality ticks and an AB length annotation. The palette uses the same geometry and projection. No coordinate axes appear.

Property Cube Square pyramid
Labels A–H A–D around the base; E at the apex
Initial edge lengths 1 unit 1 unit
Height 1 unit 1/√2
Rotation and scale origin Volume centroid Volume centroid, one-quarter of the height above the base

A fixed orthographic view fits the maximum size. Vertex letters and the AB annotation have fixed 3D anchors that rotate and scale with the figure, while text and ticks retain screen-sized dimensions. Text stays upright. Labels can overlap when their anchors project to the same location; they are neither rearranged to prevent overlap nor clamped independently at viewport edges.

Author a demo unit

Add this unit to the TDF's tutor.unit array:

{
  "unitname": "Geometry with hand tracking",
  "skeletondemosession": {}
}

Do not combine it with another session selector, adaptive transitions or enabled gazeTracking. The canonical configuration repository contains editable files in Skeleton Demo/ and the upload package Skeleton_Demo.zip. The example has one demo unit and an empty stimulus file, with no questions or placeholder answers. Upload it through the content workflow.

Gesture reference and measurement limits

Rotation uses estimated 3D wrist, index-base and little-finger-base landmarks (0, 5 and 17). These define the palm plane and its in-plane axis independently of fingertip positions, extension or overlap. Each accepted observation applies the complete shortest relative 3D rotation, including tilt and twist. Forward/backward wrist tilt is reversed about the camera-horizontal axis; lateral turning and clockwise/counterclockwise motion retain their directions in mirrored and unmirrored views.

There is no application-level temporal smoothing, angular-velocity smoothing or delayed catch-up, so sensor jitter can appear directly. The speed gates below reject movements rather than smoothing them. Rotation and resizing retain the controlling hand while it is identifiable; both require an unambiguous identity with confidence at least 0.7.

Check Current value or behavior
Degenerate palm Triangle area ratio below 0.08 disables rotation
Shape distortion Normalized side-proportion change above 0.12 rejects motion
Turning speed Above 720 degrees/second is ignored
Screen translation Above 6 palm widths/second is ignored
Apparent hand-size change Above 4.5/second is ignored
Selection pinch Thumb/index gap at most 80% of estimated 3D palm width
Resizing pinch All three fingertip pairs at most 80% to enter; at most 95% to remain active
Tracking gap More than 250 ms establishes a fresh reference

Palm width is the 3D distance between index and little-finger bases; pinch ratios do not use foreshortened 2D camera distances. At an estimated palm width of 60 mm, an 80% gap is 48 mm, so fingertips need not touch. These are model estimates, not calibrated physical measurements. Apparent hand-size change is only a coarse depth cue; hand-centered landmarks do not measure position in a room.

Selection needs visible valid thumb and index tips; resizing also needs the middle tip. Palm rotation needs usable palm landmarks but no fingertips. Missing, invalid or off-screen fingertips therefore stop only gestures that require them. The tracker must still detect a hand and supply usable palm estimates; missing points are not fabricated. Tracking gaps, ambiguous directions, mode/owner changes and rejected motion reset the movement reference. Reacquisition resumes rotation or resizing without a jump, while a valid selection pinch takes effect immediately.

Experimental 3D pose comparison

Expand 3D pose matcher comparison in the preview's lower corner and start the camera. Keep both shoulders, elbows and wrists visible, capture a template, then choose Calibrate person and move both arms through 45 well-tracked frames. Return to the reference pose to compare direct distances with a skeleton adjusted using fixed target-to-person segment-length ratios.

Calibration uses segment medians independently of comparison scores. Lower normalized squared error indicates closer geometry; no recognition threshold is claimed. An optional global scale fit applies to both methods, and calibrated error without that fit is also shown. Labels remain left/right, reflected geometry is treated as equivalent, and fingers are outside this comparison.

The template, calibration samples and scores remain in memory until Clear comparison or unit exit. Stop camera clears current scores and pauses collection. Geometry selection, rotation and resizing remain active. The panel overlays the preview and scrolls on small screens. The application repository's pose-comparison method defines the detailed method and deterministic/synthetic protocol. Physical camera reliability and recognition accuracy require evaluation with people and actual devices.

Implementation and camera ownership

The normal demo loads only the hand model. Opening the comparison panel requests the body model on the next processed frame. Closing the panel releases that model when the next frame is processed. Stopping capture also terminates the worker. While both models are requested, they use the same input frames and timestamps. Models and assets are hosted locally. Camera images and positions are not transmitted or saved, and the demo's labels are English.

Starting the demo's camera hands the shared camera lease from gaze to pose. If you return to a tracked practice unit afterward, calibrate gaze again. Camera ownership and handoff

Leaving the lesson or signing out releases the camera. Stop camera, device switching, and unmounting the demo also cancel pending demo work and release its resources.

poseTracking.ts schedules at most one inference frame at a time and at most 15 Hz, skipping duplicate decoded frames. It transfers one temporary ImageBitmap to poseTrackingWorker.ts, which runs the pinned local CPU models and closes each bitmap after inference. Stopping terminates the worker, including pending model/WASM loading. Observation timestamps mark monotonic inference input, not physical camera capture. The app receives landmarks and confidence; FigureOverlay.svelte applies the 0.7 identity threshold at the gesture-consumer boundary, while gesture interpretation belongs to learning-components/.

The worker isolates Tasks Vision's Emscripten globals from WebGazer's FaceMesh runtime. Browsers must support workers, transferable ImageBitmap and OffscreenCanvas; initialization or inference failure produces an explicit unavailable state. Worker bundles export through globalThis, which is available in pages and workers. Exporting through window prevents worker startup.

Three.js math is loaded for this demo to project the figures into a theme-controlled SVG display. It requires no WebGL context. Loading or projection failure stops the camera and reports an error. The MIT notice is served at /licenses/three-LICENSE.txt. See the application repository's implementation guide for component ownership and setup.

Evaluate the prototype

Try both hands with repeated slow/fast/slow strokes, lowering the hand, finger bending and movement toward the camera. Confirm that fast motion leaves the figure still and slower motion resumes without jumping. Test both palette targets, palm tilt and twist, resizing in both directions, size-limit reversal and per-figure restoration. Include partial hand visibility at all four frame edges, all four Camera/Wireframe combinations, and both Default and Dark Industrial themes.

Controlled lifecycle checks run from mofacts/:

node --test scripts/cameraTrackingSuite.test.cjs scripts/gazeTracking.test.cjs
node --test scripts/skeletonDemoBrowser.test.cjs

The browser suite requires the supported localhost watcher. It uses synthetic video to check real-library gaze-to-pose handoff, worker output, gestures and display behavior. These checks do not establish physical tracking accuracy. Measure frame copy, inference and drawing separately when investigating latency; inference turnaround excludes camera exposure, decoding and display latency.