The science
Pinhole camera. A 3-D point X in camera coordinates (x, y, z) lands on the image at u = f x / z + cx, v = f y / z + cy, with focal length in pixels f = (W/2) / tan(FOV/2) for an image W = 640 px wide.
Marker tracking. The printed square is a plane, so its four corners map to the image by a homography H. The page solves the 8 linear equations (direct linear transform) from the four detected corners, removes the camera matrix, K-1H = λ[r1 r2 t], completes the rotation with r3 = r1 × r2 and re-orthonormalises it. The virtual cube is then drawn with that estimated pose (green); the white dashed cube is the exact pose for comparison.
Errors. (1) Noise: Gaussian error on each detected corner propagates into pose; it grows for small or far markers and for grazing viewing angles. (2) Latency: the overlay uses a pose from τ seconds ago. When the head turns at angular rate ω, a point near the image centre is displayed late by Δu ≈ f · ω · τ pixels. The page measures this by projecting the true poses at t and t - τ and compares it with the formula (valid for small ωτ).
Honest simplifications. Ideal pinhole lens (no distortion), perfectly known camera matrix, the four corners are the only measurements (real trackers use many points and filtering), no occlusion, no rolling shutter, no sensor fusion or prediction (which real headsets use to hide latency), constant white noise. The marker pattern here is decorative, not a real fiducial dictionary.