H|AR Term

Hit Testing

Also known as:AR hit test

Hit testing checks where a ray or other query intersects a target, often to find a candidate location for AR content.

From a screen direction to a position

A visitor points a phone toward a tabletop. The application can cast a ray from a viewing direction and ask whether it meets an estimated surface. A result may provide a position and orientation where an object could be placed. The application still needs to decide which result to use and whether the surface is suitable.

An intersection is a placement candidate, not a guarantee of persistent alignment. Play the short loop to compare the movement.

A hit is not a complete scene understanding

WebXR hit testing can use supported real-world geometry types, while a 3D engine can also test virtual objects already in its scene. Those are different sources of geometry. A successful result does not prove that a whole sculpture fits, that the surface is clear of obstacles or that placement will remain stable indefinitely. It may need an anchor and further checks.

Designing a clear visitor action

A placement reticle should communicate when a usable candidate is available, rather than leaving the visitor guessing. For a proposed Painta exhibition, establish whether surface placement is actually required or whether attachment to a known artwork would be clearer. Hit-test availability depends on the runtime, browser and device; an ordinary clickable 3D preview is not evidence of real-world hit testing.

Related concepts and further reading

MDN: WebXR hit testing