Skip to content

point2ToNdc

point2ToNdc(p, viewport): Vec2

Defined in: coordinate-spaces.ts:14

Converts a point in pixel coordinates to normalized device coordinates (NDC).

Point2

The point in pixel coordinates.

Size2

The size of the viewport in pixels.

Vec2

The point in NDC, where x and y are in the range [-1, 1].