Add live-webcam Teblid AR example + examples index (#36) - #37
Merged
Conversation
New live-camera AR example using the Teblid tracker, built on the static example's conventions (consume matrixGL_RH directly, projection as-is, no pose correction) + a continuous bufferCopy main<->worker ping-pong loop + a getUserMedia feed. RGBA end-to-end (tracker converts internally). Cube + axes anchored at the marker origin, hidden when not found; on-screen Marker-tracked/Searching status (console logging kept). - examples/worker_teblid_webcam_threejs.js (dedicated bufferCopy worker, emits matrixGL_RH) - examples/threejs_teblid_webcam_worker_ES6.js (start() module / live loop) - examples/threejs_teblid_webcam_ES6_example.html (page + camera bootstrap) - examples/index.html (grouped landing page) - docs/design-webcam-teblid-example.md (design + decision log) No existing example modified or removed. No library changes / no rebuild. Known limitation (not this PR): tracking is not declared lost when the marker leaves frame -- see webarkit/WebARKitLib#46. Refs #36 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add an in-code comment by the tracking-status logic explaining that found/tracked reflects the library's isValid(), which does not reliably clear when the marker leaves frame (stale lock). Points readers to webarkit/WebARKitLib#46. Refs #36, webarkit/WebARKitLib#46 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a working live-webcam AR example using the Teblid tracker, plus an
index.htmllanding page for all examples. This implements the webcam half of #36; the examples-cleanup half (retiring the broken demos) is intentionally deferred — nothing existing is modified or removed here.dist/WebARKit.jsalready ondev(post WebARKitLib#45).What & why
The existing webcam examples are broken. This is a clean, working live-camera reference built on the now-correct library: it consumes the corrected GL pose (
matrixGL_RH) directly — no render-side pose hack — and combines the static example's conventions with a continuous bufferCopy ping-pong loop and agetUserMediafeed.Files
examples/worker_teblid_webcam_threejs.jsmatrixGL_RHexamples/threejs_teblid_webcam_worker_ES6.jsstart()module — scene + cube/axes, live loop, hides content when not foundexamples/threejs_teblid_webcam_ES6_example.htmlinitCamera, actualvideoWidth/Height,CAPTURE_W/Hconstants)examples/index.htmldocs/design-webcam-teblid-example.mdDesign decisions (see the design doc for the full log)
ArrayBuffer(avoids per-frame GC); the chosen perf path.convert2Grayscale).#video+#canvasshare the capture aspect andobject-fit:cover, so AR overlays the video exactly; projection used unscaled.environmentdefault, resolution as a constant for the higher-res check.Testing
Manual / on-device: open
examples/threejs_teblid_webcam_ES6_example.htmloverlocalhost, allow camera, point at a printeddata/pinball.jpg. Verified live tracking with the cube + axes anchored on the marker, right-handed (red→right, green→up, blue→toward viewer); content hides when the marker leaves frame; status badge flips correctly.Review checklist
index.htmllinks resolve fromexamples/Risks / known limitations
if(_isDetected)branch), not introduced by this PR. Tracked in Tracking never declared lost when the marker leaves the frame (_valid/_isTracking stuck) WebARKitLib#46.#video/#canvas(identical, so alignment holds).Related
Refs #36
🤖 Generated with Claude Code