You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Teblid AR examples (static-image #30 and the new webcam example #36 / #37), the rendered content (cube + axes) is anchored at the marker's top-left corner, not its center. We'd like content to sit in the middle of the marker by default.
Why
The tracked pose's origin is object point (0,0,0), which is the reference image's top-left pixel — the tracker's 3D object points are raw image pixel coordinates (pt3d = cv::Point3f(x, y, 0) in TrackingPointSelector / GetTrackedFeatures3d). So root.matrix places the marker origin at that corner, and content at local (0,0,z) renders there (= corner 0 / reference top-left).
Options
Example-side offset (local, simple). Translate the content by half the marker size in marker-local units, e.g. box.position.set(refW/2 * s, refH/2 * s, z) with the correct Y sign (object Y is down → GL Y up after DRD). Done per example; no library impact.
Library-side origin centering (broad, ArtoolkitX-like). Center the object points (pt3d = (x - refCols/2, y - refRows/2, 0)) in TrackingPointSelector so the pose origin is the marker center for every consumer — matching the usual ArtoolkitX marker-center convention. This changes the pose origin for all examples (a convention change), so it would live in webarkit/WebARKitLib and be coordinated with the existing pose work (fix(#55): rename pose getters (getPoseMatrixCV/GL) + getPoseMatrixCV zero-matrix fix #45).
Recommendation
Decide between a quick per-example offset (Option 1) and a library origin-centering convention (Option 2). Option 2 is cleaner long-term (all consumers get a centered origin) but is a broader, cross-repo change; Option 1 is an immediate local fix.
Context
Observed on the static-image example (#30) and the webcam example (#36, PR #37): content currently anchors at corner 0 (reference top-left). Not in scope for #37.
Summary
In the Teblid AR examples (static-image #30 and the new webcam example #36 / #37), the rendered content (cube + axes) is anchored at the marker's top-left corner, not its center. We'd like content to sit in the middle of the marker by default.
Why
The tracked pose's origin is object point
(0,0,0), which is the reference image's top-left pixel — the tracker's 3D object points are raw image pixel coordinates (pt3d = cv::Point3f(x, y, 0)inTrackingPointSelector/GetTrackedFeatures3d). Soroot.matrixplaces the marker origin at that corner, and content at local(0,0,z)renders there (= corner 0 / reference top-left).Options
box.position.set(refW/2 * s, refH/2 * s, z)with the correct Y sign (object Y is down → GL Y up after DRD). Done per example; no library impact.pt3d = (x - refCols/2, y - refRows/2, 0)) inTrackingPointSelectorso the pose origin is the marker center for every consumer — matching the usual ArtoolkitX marker-center convention. This changes the pose origin for all examples (a convention change), so it would live in webarkit/WebARKitLib and be coordinated with the existing pose work (fix(#55): rename pose getters (getPoseMatrixCV/GL) + getPoseMatrixCV zero-matrix fix #45).Recommendation
Decide between a quick per-example offset (Option 1) and a library origin-centering convention (Option 2). Option 2 is cleaner long-term (all consumers get a centered origin) but is a broader, cross-repo change; Option 1 is an immediate local fix.
Context
Observed on the static-image example (#30) and the webcam example (#36, PR #37): content currently anchors at corner 0 (reference top-left). Not in scope for #37.