Impacts and coordinates
target.hit carries a physical point: x_mm and y_mm, with a bottom-left origin.
Normalization
The HTML5 SDK adds nx and ny by dividing millimetres by manifest width_mm and height_mm, then clamping to 0…1. Original x_mm and y_mm remain available. Use shot_id to prevent duplicate scoring. source and demo retain event provenance.
Canvas and WebGL
Canvas starts at the top-left, so Y becomes 1−ny. toCanvasPoint accepts an explicit viewport in drawing units. CSS size, canvas.width and devicePixelRatio are different quantities; use the same units for the viewport and rendering. For WebGL NDC use X=2nx−1 and Y=2ny−1.
Active area
If the picture covers only part of the physical target, first transform the physical normalized point into that active area and reject hits in the margins. Passing a narrower drawing viewport into toCanvasPoint does not perform this clipping automatically.
Measurement limits
An event means a registered impact on the target surface. The SDK does not observe shots missing the surface and cannot identify the shooter from an acoustic coordinate. Do not describe event count as the total number of trigger pulls.
Code example
Integration excerpt: game-specific variables belong to the application. Playground contains the runnable reference.
const point = toCanvasPoint(hit, {width: canvas.width, height: canvas.height});
const ndc = {x: hit.nx * 2 - 1, y: hit.ny * 2 - 1};